Dynamo Periodic Run

Hi All,

I have a script that extracts some parameters from an Excel file and does some operations afterward. When I run it Manually, it works just fine, but it gets in some kind of an infinite loop if I set it to periodic.

The idea is: I want the script to look in a certain directory and keep checking (every peiriod of time) if there is a “newer” excel file to update the results, so I used some nodes to get the latest file found in the directory but I am facing a problem with periodic run. what could be the problem?

I would strongly suggest you avoid running Dynamo in periodic mode for this exact reason. The intent of periodic mode is not to run Dynamo in the background on a routine basis as it will constantly interrupt any Revit processes.

What is the exact workflow you’re trying to enable here? Can you get by with an on-demand import instead of automatic?

3 Likes

Try disconnecting the excel path, and then set the run mode to periodic. It’ll error out but it will do so very quickly. Then set your periodic mode to say five minutes (300000 ms). If your graph runs in less than five minutes, you should be fine. If it takes more than 5 minutes… you’ve got other problems to address.

As Nick noted, generally speaking if you need ‘updated’ external data excel and local files are bad. Utilizing a web request would be a better fit; that will require moving to another data entry point, but you’ll be better of in the Dynamo context.

1 Like

Thank you for your answer.

The script takes less than 2 minutes to run, so I will try to make it work.

Which kind of data entry point would you recommend?

Web based tool with a robust API.

2 minutes to run on something you plan on doing more than once a day is beyond the point of reconsidering the system architecture or scope.

It’s a “research” topic that should be expanded in the future, and should be automised as much as possible. It’s not a “real” project but should be applicable to one.

I second Jacob’s suggestion of a web tool. Dynamo is not the right solution to your problem. I would argue that the structural analysis of your design should not change significantly or often enough to require “live” data in Revit. If you’re wanting visual feedback on how live circumstances are affecting your design then Revit isn’t the right solution either. It can certainly be appropriate for on-demand feedback but neither are meant for live data.

1 Like

All the more reason it should be web based not excel based…

Where is your excel data coming from that you want to automate with?

Can you do a quick diagram showing where the data is coming from and going to?

Revit for the building shape.
SAP2000 for… Something.
Sensors for something else.

What is updating in that data set? The sensor data perhaps?

Need to understand what you’re doing to give guidance.

I appreciate it, thank you.

First part is the sensors data, when a specific value is reached, analysis in sap will be triggered, and the analysis results are (up to this point) exported to an excel file and saved in a certain file.

The second part’s target is to reflect those results in an IFC file. I made a dynamo script that does that but it requires a user to actually run the script.

The research part is the elimination of the need for a user. The files exported from sap could be updated at any time and we need a live link to IFC.

I hope you see the idea, and thank you again for your help.

Interesting project. To confirm the architecture: you have sensors sending data to SAP when things reach a certain situation, SAP is using those values in a predefined model to perform an analysis, the results of which
are sent to an excel file, which you are using with Dynamo for Revit to generate an IFC of a predefined model with updated values.

That is impressive, although kind of a house of cards - with sensors and their web connectivity, SAP, Excel, Revit, and Dynamo… if any of those go belly up you’re out of luck for the duration of that time period. However I’m sure it works if a CPU has all the software running 24x7 and you limit the sensors to sending once every 5 minutes…

A better overall architecture would be to remove one or more of the translation softwares from the system.

  • If SAP can write IFC, why not go sensors > SAP > IFC?
  • Or if you can do the math for the analysis on your own why not go sensors > Dynamo > Revit > IFC.
  • If the work of Dynamo is just updating parameter values, maybe just go SAP > Dynamo > IFC?
  • Ideally SAP would send to a json string to a web platform or something like an SQL database instead of excel, which would make Dynamo and Revit both faster and more stable.
  • You could also leverage design automation to drive your Revit model and the IFC export, and have SAP save to ACC directly, so any time a new file comes in you get a new IFC automatically. Might even be able to do the analysis up there instead of in SAP if you know the formulas being executed…

All of the above require reconfiguring your process. From what we can tell though if you limit updates of the SAP data to 2x your periodic Dynamo run time, and your periodic run to 2x your graph execution time, you should be good to confirm fully sensor driven automation.

1 Like

This is beyond helpful! I can’t thank you enough for taking the time to share your knowledge. I will rethink the workflow and this will definitely help alot.
Thank you again!

1 Like