Running a function/ document X amount of times

Hello GH community,

hope you are doing well!

I want to have my functions/ my document recompute X amount of times automatically - how could I possibly do this?

Background: In my document, a large amount of different geometry gets randomly picked and paired. Each time this happens, this random pair is exportet as a Rhino file. Now since I want to repeat this action a couple of hundred/ thousand times I of course don’t want to do it manually. Would this need to be done with a script?

I am no stranger to GH and have used it in a design context for some years, but I have no experience in writing own scripts.

Also, since the functions may take a couple of seconds to run through and export, it would be important that GH starts to recompute the next iteration only when the previous one is finished.

I do work with seed numbers, so the trigger for the next recompute could be to just increase the seed number - but then I would probably need to include some kind of delay, to not overwhelm GH in the process of ‘recomputing - exporting - recomputing - exporting etc’.

Can anyone help?

Hi
I guess with the contribution of these two plug-ins you get what you need.
Anemone Plug-in for creating Loops
Elefront Plug-in for managing the layers and exports issue

Hi Ali,

thanks a lot for your help - tried it out and made it work!