In 2015 we used to be able to create range sliders that moved in integer values.
e.g. when I wrote @Range(2,10), I would only get 2,3,4,5,6,7,8,9,10 as my options on the slider
Now when I write @Range(2,10), I get 2.0, 2.1, 2.2, 2.3........9.9,10.0.
Is there no way to force the range sliders to stick to integer values anymore?
Solved! Go to Solution.
Yes, I see this is a problem. Sorry, unfortunately, the step size is automatically determined and cannot be changed. Thank you for the valuable input.
If you really need to use the integer values in the code, you can create another variable and use rint() to round the values you get from the slider. You just won't see the rounded values in the slider.
@Range(2, 10)
attr a = 2
const b = rint(a)
Yes, I see this is a problem. Sorry, unfortunately, the step size is automatically determined and cannot be changed. Thank you for the valuable input.
If you really need to use the integer values in the code, you can create another variable and use rint() to round the values you get from the slider. You just won't see the rounded values in the slider.
@Range(2, 10)
attr a = 2
const b = rint(a)
Hi Cheryl,
Thanks for letting me know. Do you have an idea if this will be adjusted in a later release? The main concern that I have heard is if a person is using a slider to adjust the number of floors in a building, they don't want to slide to a value of 2.8 floors, but rather want whole numbers that are realistic to true building values. Even if the rule is rounding, the inspector panel will still show a decimal value.
True, thanks for the idea. I guess I'll have to use it as a workaround for now.
Additional remark:
The CityEngine help on Annotations points out, that @Range(value1, value2, value3, ...)
can be numeric or string.