Dyn files have the same Uuid

Hello,

I’ve noticed that every file created and saved from the same Dynamo instance has the same ‘Uuid’ value. This causes the files not to be unique, so they must be compared by their name or something else. I’m currently storing the files by Uuid in a database along with other parameters. However, I hoped to rely on the Uuid as a unique identifier, but it doesn’t seem possible. Do you have any other suggestions for associating a unique GUID to the files?

Thank you.

1 Like

Hi @Michael_Kirschner2, any suggestions?

We as Dynamo Team are aware of the issue and starting from Dynamo 2.18.0 release, the Save As function ( Not Save) in Dynamo will assign a new uuid to the graph and all graph elements. Not sure if you could make the switch to 2.18.0 release immediately, if not, you may need to use some uuid generator for it yourself unless there is an existing view extension or package to do that.

My 2 cents.
Aaron-

1 Like

Here is a quick sample of what we can achieve with a view extension (monocle).

The GIF below shows the following:

  1. Doing a quick save as of a sample graph as is to store the original state with GUIDs (with timestamp).
  2. A second command to force a save with new GUIDs each time.

I have wanted this to make the insert command more usable, so I am excited about this myself. :slight_smile:

20230508-betterSaveNew Guids

7 Likes

Thanks, @john_pierson, for sharing this!
Very useful.
It may be necessary for me to capture when a user intends to save the file or in certain specific situations. However, simply substituting the UUID value is a viable solution.
I thought about changing the UUID value but wasn’t sure if that was the best solution. :slight_smile:
Thanks, both.

1 Like

Here is the code only to change the Uuid.

string jsonData = File.ReadAllText(workspace.FileName);
string pattern = "\"Uuid\"\\s*:\\s*\"([^\"]+)\"";
Guid guid = Guid.NewGuid();
string modifiedJson = Regex.Replace(jsonData, pattern, $"\"Uuid\": \"{guid}\"");
File.WriteAllText(workspace.FileName, modifiedJson);