algorithmic modeling for Rhino
Suppose we have a list of n items with values from 0-360 and we wanted to dispatch those items with value between 200 and 300. I have tried doing it all in a single step with a function with this expression:
If(x>A, 1, If(x<B, 1, 0))
and two sliders connected to the function, with slider A set to 200 and slider B set to 300. But what it does is output everything 1, because it changes the items with value less than 200 to 1, and then in the second if, well everything is smaller than 300.
Is there a way to apply multiple conditional statements in the function editor, as can be done in Excel?
Tags:
Thanks Danny. I can't remember the last time I used the Find Domain component. It's a nice reminder.
I did it beforehand with two dispatches, but I was hoping for something like what Djordje pointed out.
Danny's knowledge exceeds far beyond yours and mine altogether.
So he was perfectly aware of the "if" statement usage in the Evaluate component.
He's intention was to created a solution with native grasshopper approach, with no programming connection. Which is quite logical, as grasshopper does not require programming knowledge.
Flattery gets you everywhere :)
You're right in the fact that I was going for the purist approach but I think Jesus was specifically referring to the AND Boolean operator that you included.
The Expression functions draw upon the VB functions so usually anything that works in VB will work here. You can see a good list in the Expressions Functions Menu from the Expressions Editor, but of cause AND OR etc don't feature there.
Ok, now where's that free boat you promised, for all the upper flattering?
:D
In my line of work its at the bottom of the sea :)
Yep AND, OR are not featured there, so I just assumed it couldn't be done. Assumptions the mother of all...
Is the free boat the one on his avatar?
And yes, my programming skills are non-existent... for now.
That's my beloved B14! http://www.grasshopper3d.com/video/b14-blur
Always up for sale / sail but never for free :)
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2025 Created by Scott Davidson.
Powered by