Dotnet system.guid - inaccessible in maxscript.

Dotnet system.guid - inaccessible in maxscript.

jonahhawk2
Explorer Explorer
1,191 Views
3 Replies
Message 1 of 4

Dotnet system.guid - inaccessible in maxscript.

jonahhawk2
Explorer
Explorer

I am having trouble getting at “System.Guid” as a dotNetObject. Loading the assembly does not work either. 

Has anyone else had issues with this or is it just me? 

I have written a substitute for it which generates hex values in the same format, but somehow I feel better about using the dotnet version. 

thanks in advance 

0 Likes
Accepted solutions (1)
1,192 Views
3 Replies
Replies (3)
Message 2 of 4

denisT.MaxDoctor
Advisor
Advisor
Accepted solution
guid = (dotnetclass "System.Guid").NewGuid()
guid.ToString()

where is the problem?

Message 3 of 4

jonahhawk2
Explorer
Explorer

Thank you, Dennis. I am the problem. 
Why is loading Guid different than loading System.xml or System.regEx (forgive my capitalization, I don't know the case by heart)

0 Likes
Message 4 of 4

denisT.MaxDoctor
Advisor
Advisor

System.Guid is an Object, and it has its own constructors. Usually you should read documentation 😉 but if you are lazy like me you can check a .NET object constructor by calling for example for this case:

 

 

dotnet.showconstructors (dotnetclass "System.Guid")

 

 

and you will see that there is no simple constructor as (dotneobject "System.Guid")

so you need a special way... and you can check class methods:

 

 

showmethods (dotnetclass "System.Guid")

 

 

 

where ".NewGuid()" looks like yours


 

0 Likes