[Closed] [.NET SDK] Getting the 3dsMax version
Does anyone know how I can get the 3dsMax version using the .NET SDK wrapper? I’m looking for an equivalent to the maxscript “maxversion()” function.
in c++ it’s in the maxversion.h file. it’s a list of predefined values.
max 2010
#define MAX_VERSION_MAJOR 12
#define MAX_VERSION_MINOR 0
#define MAX_VERSION_POINT 0
#define MAX_PRODUCT_VERSION_MAJOR 12
#define MAX_PRODUCT_VERSION_MINOR 0
#define MAX_PRODUCT_VERSION_POINT 0
#define MAX_PRODUCT_YEAR_NUMBER 2010
#define MAX_PRODUCT_VERSION_SP “\0”
#define _MAX_VERSION(a, b, c, d) a##b##c##d
I had found those too. But now the question is, how to obtain this through the .NET SDK wrapper?
going by the c#.net flag wavers on here isn’t it suppose to be version independent ? perhaps that’s why versioning was never added to the wrapper ? :shrug:
Sure, but that doesn’t mean that it would not be useful to know. You might want to send it to a webservice which handles automatic updates for example.
The .NET wrapper does have the UtilityInterface namespace, but the only thing in there is the EProductID enum. And that doesn’t seem to be used anywhere…
You need to go through the running instance of max:
Autodesk.Max.GlobalInterface.Instance.UtilityInterface.CurrentVersion
Hmm that doesn’t seem to exist? I’m using 3dsMax 2013, could it be that they added it to the wrapper in a later version?
Yeah, you’re right, It does not exist in 2013.
This works in maxscript so it should work in c#:
g = (dotnetclass "Autodesk.Max.GlobalInterface").Instance
r = g.executescript (g.stringStream.create("maxversion()")) true
r.print()
which prints “#(15000, 40, 0)”
This should be trivial to translate to pure c#