[Closed] spinner value question
hello all. i have this strange problem with a really simple script.
i simply made a rollout with a spinner and a button to assign the value of the spinner to the height of my parametric object. no big deal
But when i try it its acting really weird. For example; if i say my height is 350 it goes up to 2000, plus my spinner can;t go higher than 100 but the range i assign to it go up to 2000.
I use centimeter for scale so maybe there a “UseWorldUnit” or something like it.
if someone can spot the mistake a mide i would be really grateful.
thanks
here my code
macroscript sizechanger category: "mytool"
(
global sizeChanger_Rollout
global sizeChanger_floater
global sizeval
rollout sizeChanger_Rollout "size Changer"
(
spinner sizeVal "value" range:[0,100,2000] type:#integer width:100 align:#center
button Do_but "Do" width:100 align:#center
on Do_but pressed do
(
$.height = sizeVal.value
)
)
if sizeChanger_floater != undefined then CloseRolloutFloater sizeChanger_floater
sizeChanger_floater = newRolloutFloater "sizeChanger v1.00" 130 120
addRollout sizeChanger_rollout sizeChanger_floater
Your problem is here: range:[0,100,2000]
First value is minimum spinner value, second is MAXIMUM, and third is default spinner value.
Change Your range to [0,2000,100].
thanks Mr Mir, i knew it was something really simple. i appreciate your help ‘specially because its a case of “RTFM”
for your spinner, you can set it’s type to #worldunits.
From the reference: