Grasshopper

algorithmic modeling for Rhino

is there a "button" node in Grasshopper which only activate once every time when it's pressed?

is there a "button" node in Grasshopper which only activate once every time when it's pressed?

I know there's a boolean toggle in Grasshopper, but it'll stay as on/off if you don't change it.

Suppose u forget to switch off the boolean toggle to control an intensive simulation, and u save the file, the next time the gh file is open it'll take quite a while to open.

So, a button will only activate the simulation once in this scenario.

Any advise?

Views: 6274

Replies to This Discussion

You can use the Data dam

How would a Data Dam help solve this problem? I am a little shaky on my understanding of the Data Dam component, but I am interested in hearing your explanation if you're willing to share. I have seen it working in other scenarios, but not in conjunction with a button.

Data dam won't resolve the opening problem.

There is a button component. Which turns true once pressed and the back to false.

However I believe you are already aware of this.

You can code your way out of an accidental run when you open a document by accessing all the boolean toggles in you GH document and setting their value to false.

Best,

M.

Just to followup, a script that modifies the XML using a regex would be able to accomplish this rather simply.

Hello.I would use a trick like below. The simulation occurs every time you hit the button, and the result get stored for further simulation.

However, don't forget to delete the data before hitting the button again, otherwise you'll double your data !

I hope it helps !

Sorry for the delay.

Please have a look at the attached C# snippet. Is this what you're looking for? It's not a clean code but it does the trick.

Attachments:
First disable the solver via Grasshopper menu. Then manually recompute after opening, also via Grasshopper menu. Despite the solver being off a single cycle will initiate each time you activate it like this.

noted with thanks, guys, for the suggestions on the "button" component and the disable solver function of GH!

This is what I use. I place it before chunks of script that take a long time to calculate. This prevents the chunk from running when the script is open because the recorded data is reset. Click the button to run and the "x" on the record node to clear. 

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service