Grasshopper

algorithmic modeling for Rhino

Hi

 

I have been programming a bit in processing, where I'm used to have a 'setup' and a 'draw'.

 

I am trying to learn to do programming in the C# component within Grasshopper

Let's say I want to move a point step by step.

The C# component will read the code once and return the new location of the point. But I want the component to take this new point and move it again, and do the same thing over and over. I have tried to use the snake hoop, which works for this very procedure.

But let's then say that I want the point to change direction when the X-value is a certain value (I'm moving the point with a Vector3D). Then it starts to get quite complicated. I can of course just use more snake hoops, but there has to be a better solution.

 

 

Timo

Views: 521

Replies to This Discussion

And it is quite important to use the newly generetated point, and not just use an increating value of the Vector magnitude as I eventually will let points interact with each other.

Hi Timo,

Grasshopper doesn't operate on the 'setup' 'draw' mechanism. It's event based. Data is typically not carried on from one iteration to the next.

You can add class level variables to your VB/C# script which do allow you to remember values from one iteration to the next, but that variable is then divorced from the rest of Grasshopper.

--

David Rutten

david@mcneel.com

Tirol, Austria

Is it then possible to animate the itterations in the Rhino window?

If you want to trigger new solutions you can use a Timer object. Be sure to link the timer to your script so it will ensure that the script will run during the next solution.

--

David Rutten

david@mcneel.com

Tirol, Austria

Thanks a lot for your answers. Is it possible to connect the timer to the c# COMPONENT (without writing a component from scrath) - if yes: can you give a hint on how :)

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service