Retrigger in Rhino 7

Right now I have a C# script in Grasshopper where I push a toggle, and a randomly-seeded object is generated, and saved to disk. I want to make many of these objects automatically, so I am looking to write a grasshopper C# plugin that re-triggers upon completion, preferably indefinitely until a switch is flipped, or at least until a specified number of iterations is reached.

How do I listen for the completion event? How do I select the specific component to re-trigger? Or how do I tell the entire page to refresh upon completion? Or if not listening for an event, can I set a timer to re-triggers every x seconds? I think there are new features in Rhino 7 that make the timer easier than Rhino 6?

Why not simply use Anemone to loop the script?

You can use a Trigger object to auto start a new solution n milliseconds after the current solution completes.

1 Like

Very handy, thank you!

@DavidRutten there is no halting condition for this trigger scheduler. I would like to make one myself. How can I create a counter in C# that will persist between executions? I envision two timers, so it will run once a second for 100 times once a day.