Version control of a graph

Is there a property in the graph where the developer can add or search for some kind of version of the script such as 1.1 or 2.1. I also want to reach it using Python or C# if possible

Civil 3D and Revit 2023 - 2025

You can set a custom property to store this info. This can be read directly from any language that can read text l, doubly easy if you have Python added to it.

The property can be set in bulk when publishing a set of graphs, or you can add one manually.

For versioning as in ā€˜last time someone saved this file’ you’d have to eat ch the metadata added by windows. You can use that in conjunction with the graph’s Uuid (property in the file) to track ā€˜if things are current’.

3 Likes

Thanks @jacob.small
Yepp, the custom properties came up in my mind and it seems to be able to search for.

What I’m looking for is to use my python node that collect ā€œName of workspaceā€, ā€œtimeā€, ā€œdateā€ and ā€œusernameā€ and now I want to add the information in the custom properties.
Still need to figure out if I can reach that info from the .dyn file even if I run have the graph open.

This might need a little bit more investigation. Thanks.

Not sure if you have seen it, but this might help (once you figure out how to surface the windows metadata): Updating python node in multiple scripts - #15 by jacob.small

Execute this from outside the active dyn file (for the active file you’d want a view extension, which might be good for a new packages offering), as any open dyn will overwrite the parameter values if you save in the session.

Been awhile (Dynamo 2.8?), but it should still work baring a CPython update or two (8?).

1 Like

I went in to read in my old book about Python and the solution became in to read the graph as a json file.
After some testing and forget to rename some variables between my small script and big script it’s up and running. Time for deploy and hopefully some data of used graph. :slight_smile:

1 Like

I would say use the custom property as already discussed, but for a further solution to cover earlier versions of dynamo that do not contain this custom property is that you can read the notes block with the same reading of json.

Just got to make sure you add a bit of info at the beginning of them as standard.

Example of the notes:

2 Likes

Good point, I have had that info in my template for Dynamo but never thought about that possibility as well. Good to know that we can read info from notes as well.