What current version of Dynamo?

Hi guys, i wont to wrote for 091 and 130 version of dynamo.
How can i check programmatically "What current version of Dynamo?"
Thx.

Hi @dmitry

You can check with Notepad++. If you can’t make it, you can drop here your dyn file we can do it for you.
Cheers!

@dmitry was your question answered?

Hi @Gui_Talarico

Do you have same query or your asking to Dmitry if he has solved it? Sorry bit confused :confused:

As you see, Gui, my question is not have the decision…

@Kulkul just checking if his question was answered so we can mark as resolved.

I wasn’t sure what “What current version of Dynamo” meant:

  1. what version a .dyn file as written. in, or
  2. how can you “'detect” what version of dynamo it’s running, from within

Thx Kulkul for worry

I am intresting about any kind answer…

  1. what version a .dyn file as written. in, or
  2. how can you “'detect” what version of dynamo it’s running, from within
    Did u have any answer?

@dmitry @Gui_Talarico I will show you in about 1 hour from now. Cheers

1.To get the version the .dyn file was written/saved in just open in in a text editor like Notepad:


2.To get detect the dynamo version you are running (there are probably multiple ways)
from System.Reflection import Assembly
dynamo = Assembly.Load('DynamoCore')
OUT = dynamo.GetName().Version

ps: @Kulkul let me know you had the same approach. Curious if there are other/better ways

15 Likes

Thx a lot!!!
That What i need!!
Thx.
Kulkul, you too thx!

@Gui_Talarico @dmitry Here is another possible way without python :smile:

2 Likes

Hey @Gui_Talarico,
although I like your approach best (and I’m going to adopt it), you said you were curious if there were other ways to determine the installed Dynamo version.
For the DynamoAutomation package I have been looking up the Dynamo version in the registry, but it’s a lot more complicated than your method. Anyway, here’s how (in C#):

// Finding the installed version of Dynamo Revit
// Successfully stole this part from Dynamo StartupUtils.cs and modified it as needed :slight_smile:
const string regKey64 = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
//Open HKLM for 64bit registry
var regKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
//Open Windows/CurrentVersion/Uninstall registry key
regKey = regKey.OpenSubKey(regKey64);
//Get “Version” value as string for all the subkeys that start with “Dynamo Revit”
var installedVersions = regKey.GetSubKeyNames().Where(s => s.StartsWith(“Dynamo Revit”)).Select((s) => regKey.OpenSubKey(s).GetValue(“Version”) as string);
string dynVersion = installedVersions.First().Substring(0, 3);

This is from:
https://github.com/andydandy74/DynamoAutomation/blob/master/src/ProcessRunner/Journal.cs

1 Like

Can some one please make a video on this, this is real confusing.