Run Dynamo Scripts using Dynamo

Hi All,

I want to run Dynamo scripts using Python in Dynamo. Is that possible?

I have a challenge where I need to process multiple scripts in various Revit models. I know I can achieve this using Dynamo Multiplayer by Bird Tools or Revit Batch Processor, but I want to accomplish it without relying on any additional applications.

I already have a solution where Dynamo can open multiple Revit files, execute basic operations written in Python, and then close the files. I’ll use the same solution to run scripts sequentially on each file.

1 Like

Revit only allows one set of hooks in it at a time, so you can’t run a Dynao for Revit graph to run other Dynamo for Revit graphs. The easy way to do this will likely be custom nodes that wrap your existing graphs, with a boolean input and output so you can chain them together. Does mean you have to manage that package of custom nodes though.

One other thought: since you’re doing most work I. Python already, you could move your Python to externally loadable library, import that library, and run them by calling each function in sequence. You aren’t calling Dynamo definitions but the Python, and at this point you move your dependency from Dynamo + MultiPlayer to Dynamo + your Python library, but it does what you asked in removing the external dependency.

That said, I’d go to a full add-in before moving to this route. Faster, more stable, and stronger overall. Shifts the dependencies again to ‘your add-in’, but short of in-file macros (often restricted) you’re eventually going to have a dependency to deal with.

2 Likes