Is there a possibility to create a loop, to run a script over a period of years?

Hi guys,

I want to ask, if there is a possibility to create a loop, where a loop, where a number slider with years can run threw years?
So make something like a simulation?

Screenshot 2022-11-13 115502

There are multiple ways to do this, I think the easiest way is to create a list as input instead of a number slider, for example [1..10]; This will give you 10 outputs per node which you can then perhaps export into Excel, Revit geometry, etc. to create a slideshow or graph manually.

You could also set the run mode of Dynamo to periodic and use a time node to extract the seconds or minutes to create a way to run the simulation for different years.

I don’t know about what type of simulation/ data you are talking about so it is hard to say which approach is more suitable.

2 Likes

Looks like it’d work to feed a range from 0 to the last year, but as noted by @Daan we can’t tell what you’re doing with the current info.

1 Like

The goal is to do a screenshot for a simulation for the years 1-15.
Is this possible to do?

Apart from the loop, everything else works

Hi @stolz-andreas ,

No loop needed, just use [1..15]; in a Code Block.

Screenshot 2022-11-14 102126

How do I run it in the best way from here?

Assuming you would like to show 15 years you could use the “second output” and divide it by 4 (60/15) and do math.ceiling. This way from every minute you get 15 intervals.

Also, set the runtime to periodic and the interval to 4000 ms