Grasshopper

algorithmic modeling for Rhino

hi!

if i want to make a simple loop like the following:

int x = -3
while(x<7) {x=x+2}


is it possible to do with objects or should i try a VB component?

thanks for the support!
Z

Views: 297

Replies to This Discussion

Hi Andrei,

For a simple example like this I believe it is possible to produce the results with GH components but for something more complex maybe VB or C# is required.

hmm, from what i get from your definition, grasshopper needs to generate (aka compute) a "pool" of possible solutions, and then pick and choose from those ones. this isn't exactly economical but it works nevertheless. thanks for your input!
Andrei, it depends on how this loop affects the rest of the definition. If you want it to loop through these values at some point within the definition, and you don't want to use them as a list, then you will probably need a VB component,. If you want the entire definition to loop with these variables as an input, you might find the "animate" command helpful. Just right click on a slider, and give that slider a range that corresponds to the input values that you want. If you want the definition to repeat entirely, using the results of the previous input as a new geometry to act upon, you may need to use a VB component that bakes geometry at your output, along with another VB component that can automatically bring this baked geometry back into grasshopper.
yep, that's what i want, feedback - to use the output of one iteration as input for the next. i managed to do it with scriptable component, but i was just wondering if you can do it without using code, just to make an idea of how GH works

i didn't know that you can bake geometry within scriptable components. interesting!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service