Hi!
I have the idea of trying to extract the following data from multiple graphs automatically:
- custom nodes
- packages they belong to
- package version
This would make my life so much easier when maintaining multiple Dynamo graphs, especially when you need to upgrade a certain package version and you need to know which graph this might affect
it would also make it much easier to gradually replace them all with a single custom package I am developing myself, mostly in order to improve future maintainability.
Anyway… I currently have no idea how to do that 
So if anyone has some, that would be awesome!
Dynamo files are text documents formatted as a json. If you open the file in a good text editor such as NotePad++ you’ll get something along the lines of this:
If you change it to read as JSON things get a bit more legible, and look like this:
And now we can start to see the keys which are used in the JSON file. One of them is the “NodeLibraryDependencies”, which after you collapse everything else looks like this:
And so now we can see every package in use, the version of the package, and the GUID of each node on canvas. In this case I used Dynamo For Forma Beta version 1.6 and Mesh Toolkit version 5.0. There are 5 nodes from Dynamo for Forma and 1 node from Mesh Toolkit on the graph.
If you take any of those node GUIDs and search in the “view” section you can see the ‘name’ which is used in the Dynamo UI (including any renaming done by the author) as shown here:
Or if you search in the “Nodes” section you can see the concrete type, which will be formatted as the Library.Class.Name for the node, as shown here:
Now that you know how things are set up you can dive into building some form of script to open a .dyn file, de-serialize the JSON text, read the references, get the package names and versions, and extracting the node names (actual or in canvas) as desired. From there it’s pretty easy to make it do the same for a list of .dyn files.
Now if your graphs are of an antique nature (pre Dynamo 2.10 if memory serves) then you might not have a “NodeLibraryDependencies” tag which, which makes this enough of a pain that I recommend manually doing the upgrade into a supported build (2022 to 2025 product line, and Dynamo 2.12 to 3.1 at the moment).
Give it a shot and see where you get.
2 Likes
Thank you, Jacob! That’s actually gonna be quite easy. Never thought of simply opening .dyn file with a text editor
As for the version - those graphs are mostly between 2.13 and 2.19, so it should work
1 Like
Hello @jacob.small ,
me and @danail.momchilov got some time to test it out, and it worked out really nice. The only bad thing is, now we have a lot of work to do…
Thanks for the advice!
2 Likes