Overview:

If you have used Dynamo for any time, you have probably encountered the following scenario.

You: “Awesome, I finished this Dynamo graph. Now let me share this with my firm.” The User, You Shared the Graph With: “It says ‘Run Completed with Errors’Β  and something about packages.” You:Β πŸ˜’

If you aren’t familiar, Dynamo has a fantastic community of users, some of whom create freely available packages (Packages are like add-ons to Dynamo). This community is awesome and enables so many more use cases of Dynamo. However, with this enablement comes the challenge of managing these additional pieces of logic. Luckily, there are ways around this, and we are going to take a look at a few options in this post.

Options for Storage:

Before we even think about using our Dynamo graphs or packages, we must figure out where to store them. In a traditional office setting, there is normally a central server (on-premises) that everyone is mapped to. At my old architecture firm, this was our “R:/ Drive,” where “R” stands for, you guessed it, Resources (or Revit if that is all you have on that drive). When this was the case, we generally had a script run at logon that synchronized data to the user’s local machine. This includes (but is not limited to) Revit libraries, Microsoft Office Configuration and Templates, Dynamo Graphs, and Packages. We will cover the “syncing locally” portion in greater detail later in this post. But this did enable us to allow our users to have a great experience and not rely on a network connection, in the case of laptops. Nowadays, with many users being remote and outside of the office network (primarily), BIM managers and Design Technologists have looked at other ways to manage items such as Dynamo packages. Luckily, there are quite a few services to share files and sync them locally to your user’s machines.

Where to Locate Packages

Nowadays, we have access to all sorts of awesome cloud drives. A few of my favorites are Google Drive, OneDrive, and Dropbox. Being that most Revit projects are on the cloud as well, we are also able to use Autodesk Drive/Docs/Construction Cloud with Desktop Connector for this process. For each of these cloud services, the process is essentially:

  1. Create a folder for your Dynamo packages
  2. Create folders for each Revit version you support.
  3. Invite users to the folder to allow for local syncing
  4. Deploy the packages folder to the local AppData for each supported Revit version.

A sample package location would look like this. (I like to keep my Dynamo packages separated and tested per Revit version)

sample package folder in Google Drive (organized by Dynamo version for each Revit version)

Besides general compatibility, keeping a package folder for each supported Revit version has become more important with optional packages like IronPython2.7 and DynamoFutureFile (for older versions of Dynamo). With this package pathing in mind, we now need to write a graph to copy those folder contents into the user’s AppData location for Dynamo packages. This path is as follows:

C:\Users\USERNAME\AppData\Roaming\Dynamo\Dynamo Revit

and with that in mind, we can create our Dynamo Sandbox graph:

  1. Package source directory and the default Revit packages directory.
  2. Python script (CPython) to get the username and combine it with the default path.
  3. There is currently a known bug in Dynamo that files without extensions cannot be copied, so we remove those before the directory copy process
  4. We want to try to copy after the clean up, this section enforces that order.
  5. Copy the directories with overwriting enabled.

This graph was built to work in Dynamo sandbox, which means users can run it before opening Revit to get the latest packages. A little know fact is, Dynamo has a Command Line Interface that makes this easy.

Here is the sample DYN from above. Sync Packages

Syncing Locally (Dynamo Graph, Dynamo CLI)

So we have a few options for syncing graphs in this manner. You can:

  1. Open the graph as is with Dynamo sandbox and run it before opening Revit.
  2. Build a Dynamo CLI (Command Line Interface) script to run it from a desktop shortcut. Bonus! You can enable this to run at system startup for your users.

Using the DynamoCLI is very easy and it just takes one line of text entered into a shortcut.

"C:\Program Files\Autodesk\Revit 2023\AddIns\DynamoForRevit\DynamoCLI.exe" -o "G:\My Drive\Dynamo Packages\SyncPackages.dyn"

The first portion of the path is the location for the DynamoCLI executable, -o, is the open command, and the final string is the path of the file to launch. You take all of that and paste it into a new shortcut:

To view the steps, check out the step-by-step here: Dynamo Package Management

and with that in mind, the Dynamo graph can be executed quickly!