Grasshopper

algorithmic modeling for Rhino

Hey,

 

I wrote a simple script with the vb component and I'm having some trouble with it.

 

Short description: the script sorts a list of activities (reading a book, hanging out, watching a movie, etc) on a grid of points (3d points but with Z set to 0(zero)). The list is fed into grasshopper as a .txt file.

 

That list is transformed into a queue (in grasshopper) which sorts the activities first in first out.  Now, is there anyway to bypass the loop nature of the vb component so that when I add another activity to the queue it won't automatically recompute all the activities in the queue, because when that happens I get different iterations of the same thing. Instead I want to add to the previous iteration.

 

Thanks!

Views: 394

Replies to This Discussion

Under '<Custom additional code> you can add variables that will mantain their data after the component is solved. You can copy the list of activities to a new list defined under there and then add a conditional statement to your code that computes only the missing elements from the list. You should also add a reset toggle to reset the list.
How will they maintain their data? Could you be more specific please? And what do you mean about a reset toggle?

Hi Liviu,

 

make these variables static (Shared in VB) so they retain their value irrespective of class instance lifetime.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

See the attached example. Try adding other activities to the list.

This is very simple example and doesn't check if you changed the previous activities.

 

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service