Grasshopper

algorithmic modeling for Rhino

Removing items from a list to another list while timer is on?

Hi, I´m relatively new to VB and I am having problems with the list.remove(item) function in Vb due to index errors.

 

What im trying to is more or less like this:

 

1)Points move along a curve

 

2)When points are near another point remove them from the list where they currently are to a different list that moves them in a different direction.

 

3) keep this going as long as the timer is on with  points constantly switching lists.

 

Thank you very much in advance for your help.

Views: 539

Replies to This Discussion

Hi Nicolas,

 

if you want a VB component to operate on the data that it processed during a previous iteration, you'll need to use static variables. This makes it difficult to determine when the Component should use the the points you provide as an input and when it should use the points it has stored locally.

 

Can you post what you have got so far, or at least a step by step description of how you expect this script to interact with the user?

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thanks David for the quick reply

 

Im trying to do the following (although i can do it without changing lists, but I would still need to change lists on the following steps of the proyect so I though I might as well get it over with now)

 

Points move along a curve acording to :

Random vectors, Tangent vectors, perpendicular to the curve vectors, and a direction vector, whose values i control with sliders

 

There are 2 lists, one for points moving towards the end of the curve, and another one moving towards the start of the curve

 

When the points get a certain distance "Z" to the tips they should switch lists so they start moving the other way, and keep doing so as long as the timer is on.

 

 

I attach the grasshopper and the rhino file

 

Thanks again for the help

 

 

 

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service