# CityEngine 2016 integer range sliders removed?

1032
6
11-24-2016 07:11 AM
Esri Contributor

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?

1 Solution

Accepted Solutions
Esri Regular Contributor

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)‍‍‍‍``````
6 Replies
Esri Regular Contributor

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)‍‍‍‍``````
Esri Contributor

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.

by
Occasional Contributor III

If you want whole numbers you could use text, but that won't display a slider.

``````@Range("1","2","3")
attr val = "0"

float(val)‍‍‍‍``````
Esri Contributor

True, thanks for the idea. I guess I'll have to use it as a workaround for now.

Esri Regular Contributor

The CityEngine help on Annotations points out, that `@Range(value1, value2, value3, ...)` can be numeric or string.