am however having a problem with something simple - limiting a set of values between a fixed set that I need help with please?
For example, I'd like to transform this list . . .
(2, 16, 4, 65, 12, 41, 7, 1, 22)
into this one . . .
(5, 16, 5, 25, 12, 25, 7, 5, 22)
i.e. selecting all numbers below 5 and changing them to 5 and selecting all numbers above 25 and changing them to 25.
I know it's possible with a simple If, Not, Then series but I'm rubbish at code!
Also, is there a simple way to apply dimensions to rhino objects from within GH?
Thanks for your help!
Cheers
James…
me. But if min = 5 and max = 12, then the range will be (12-5) = 7.
If you have only a fixed number of values, why not use a Value List to encode those?
You can still use a slider to select a value out of a list of presets, but the UI of the ValueList is more friendly, especially if the list of presets isn't particularly continuous. You can extend a single ValueList to have all 12 preset date+time combos as well.
Sliders values can be post-processed using an expression. For example you could add the 'x*3' expression to a slider, and then the value 0, 1, 2, 3, ... would be mapped to 0, 3, 6, 9, ...…
Added by David Rutten at 5:30am on January 21, 2016
13 5 15 6 17 7 ... …
But it seems I have not been clear:
the input values (3,5,7,9,11,13) should be presented in the way of "number slider" parameter. So by increasing the value of the slider from minimum 3, to 5, 7, 9, 13, 15, 17... I should get an output numbers of 0,1,3,4,5,6,7...
So I if choose value 3 on the input "number slider", on the other end, I want 0 as an output.
Or if I choose value 5 on the input "number slider", I want 1 as an output, and so on.
Is this possible?…