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!
Do you have same query or your asking to Dmitry if he has solved it? Sorry bit 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:
- what version a .dyn file as written. in, or
- how can you “'detect” what version of dynamo it’s running, from within
Thx Kulkul for worry
I am intresting about any kind answer…
- what version a .dyn file as written. in, or
- how can you “'detect” what version of dynamo it’s running, from within
Did u have any answer?
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
Thx a lot!!!
That What i need!!
Thx.
Kulkul, you too thx!
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
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
Can some one please make a video on this, this is real confusing.