Use Dynamo Packages in Pyrevit

Hi there, I would like to ask if it’s possible to include the folder containing Dynamo packages in my Dynamo Tools setup.

I have added Dynamo Tools to the toolbar, meaning I am using "script.dyn". I want users to be able to run Dynamo seamlessly without needing to install the packages on their computers.

Is there any way to achieve this using pyRevit?

Probably not.
The way a pushbutton with a .Dyn file behind works is basically running dynamo headless in the background and opening your script with whatever nodes libraries you have loaded on the machine.
I don’t know if the latest versions of dynamo will offer a way to package the nodes with the script. Which would be one way to handle it.
Another way to do it, is to take care of the library of nodes with your extension.
You could use a startup script to check if the dynamo library folders contains the nodes packages you need and copy them there or just copy the whole library of packages.

The way I handled it in the past 6 years:

Startup script updates my extension from GitHub, which contains my dynamo libraries. And a subscript checks for the library path in the dynamo config XML files.
Both are PowerShell scripts run with the subprocess module in the command line

1 Like

Hi @Jean-Marc thank you for your response. I will try to do it, and if I can do it I will update here. Thanks

1 Like

You could have IT just roboccopy all the Dynamo packages into the appdata folder from a shared folder(which you keep up to date).

The users don’t have to select a package path in Dynamo but do have all the packages installed.

1 Like