Dynamo periodic

@jacob.small When Periodic run mode is enabled, does Dynamo recompute the entire graph, or only nodes downstream from the DateTime Now node?

This sound interesting
Is this used in Civil or in Revit?
Can you some example
/Patrick

Looks like the downstream only. I guess if you put an early passthrough in your script driven by the datetime you could achieve a moreorless periodic script in principle however (just not for dead end nodes in the left direction like ‘all elements in active view’). You could bundle up those sort of nodes into custom nodes however to force them to run with any valid input passed in from the periodic downstream.

See below a test using my datetime node from Crumple. Time deviates on the disconnected branch, but updates for the downstream branch:

@patrick.ericson an example of a periodic graph is below. They are driven by a condition that can change at a set interval, typically using a date time ‘now’ node as either a source of time or just a ‘trigger’. As noted above this will effectively re-run the script downstream every time the period occurs (e.g. 1 second). Not many practical applications, but lots of fun ones such as taking a condition and transforming it into a ‘next step’.

Correct. :slight_smile:

1 Like

That is what I thought. But I wanted to double-check as once again Dynamo just grinds to a halt once the graph gets ‘big’. If it were re-computing the entire graph, at least I could split it up to run faster. But since it is only re-executing downstream, the issue is Dynamo in general. I really do hope Dynamo for Revit 2023 provides significant performance improvements @solamour.

Happy to help review performance if you’ve got a graph and small data set to share.

1 Like

I’d suggest not usually trying to run Dynamo like Grasshopper in automatic mode when in Revit (sandbox maybe). Personally I use manual mode most of the time, although I know it isn’t always ideal for geometry based workflows.

That or it might pay to work with a smaller data set before taking on the full dataset if possible in automatic mode if you need it to always run to test it properly.

1 Like

@Paul_Wintour there are performance increases for sure coming in Dynamo 2.13 / Revit 2023 which should help.

For the rest of 2022, we are also putting a huge amount of calories into Performance in general (It’s one of two big focuses’ for us this year).

1 Like

Dynamo uses “Delta Compute”, which will only re-execute portions of the graph that have had changes made, and not execute anything that would return the same result regardless. This also means any downstream node from the thing that changed will be re-executed.

So, if you use the DateTime.Now node halfway through your graph, you can use periodic mode in that instance to only recompute half your graph :slight_smile: Bear in mind that you’ll want to have a larger period so that you don’t run into an infinite loop situation (i.e. compute period of every 10 seconds, but a single compute takes 11 seconds, so it never stops ‘computing’ as it kicks off the next queue instantly).

2 Likes

One thing to note: some Revit nodes which bring data from the core application into Dynamo will force a ‘recompute’ if the document has changed. These aren’t super common, but exist so it’s worth noting. Automatic run mode often gets stuck in an infinite loop with these same nodes.

Fortunately the TuneUp view extension can identify which nodes were executed anew in a given run, while simultaneously letting you know which parts of your graph are slow. May be worth checking out to see if there is added recompute or a extra slow section of code.

But Dynamo 2.13 for Revit isn’t released yet right?

Not at the moment.

It would be useful if you could set the periodic duration BEFORE it started running. At the moment, if it is too short you’ll get an infinite loop (unless DateTime node is frozen).

2 Likes

Love this so much I just submitted the idea to the wishlist: Set periodic run time prior to execution ¡ Issue #208 ¡ DynamoDS/DynamoWishlist ¡ GitHub

Means of implementation may be less important than if it’s there, but feel free to weigh in on the github link above (that’s a direct pipe to development’s ears instead of 2nd hand though me).

1 Like