Hey.
I want to find a number value closest to another list.
Like the number 135, what is the closest value in a list there contains: 50, 100, 150, 200
Any ideas on how to do that?
Nichlas
Hey.
I want to find a number value closest to another list.
Like the number 135, what is the closest value in a list there contains: 50, 100, 150, 200
Any ideas on how to do that?
Nichlas
index: the absolute value of the difference
I was thinking the same… but this way you have to turn Integer to a Double or the other way around to compare…
@jshial This will make your values integer. this way you can compare them. before they were integer vs double.
As you can see in post 3 Value closest to the Object.Type from the minimum is System.Double and the object type from the Abs is System.Int64
I did not know DesignScript has this kind of interesting syntax for casting a list. Always good to learn new stuff. Thx!
That’s right
Hey.
Now i had a chance to try your ideas, i think the problem is the codeblock, does that exist in a normal node??
The different is, that i have a list of numbers to find, and not just one, as in the example. I didn’t know it would make a different.
@Nissal
That custom node you have, i can’t find it in the Rhythm package.
Im using dynamo 2.0.3, revit 2018 and it is available
Try hot gear package