Here I will create a list of tutorials that cover some of the usage of DotNet class', objects and controls
in Max Script. I will also try to explain how to find your way around DotNet and how to get started.
If you encounter any errors on these pages or any others at paulneale.com please email me the link
to the page and the error that you have encountered, thanks.
Email
In Max 9, when Microsoft moved to 64 bit and dropped Active X, DotNet (or .net) was added as their object oriented development framework.
Active X controls still work in Max 9, 2008 and even 2009 but only in the 32bit versions. In the 64bit version Dotnet must be used.
Because Max is so tied to windows it also had to make the change to ensure that features kept working like the Layers Manager that uses the DotNet
Listview control and many others. Active X was implemented into Max script but not very well and Active X had many issues of it's own.
Dotnet is far easier to work with but takes a fair amount of work to get used to and is not for the beginner Max scripter.
Dotnet is a frame work of objects that are used to control how things look on screen, how data is managed or how your system is setup.
I can't go into everything that you can do with Dotnet as I don't know it to that level, I'm not sure that any one
person can. For people starting out with Dotnet in Max script it is usually to try and enhance the look and feel of the
user interfaces that they are creating for production tools and system.
You can find more information about dotNet at the MSDN developers site
http://msdn.microsoft.com/en-us/library/default.aspx
This again would be a very long list that really doesn't need to be covered. Some of the most used will be dotNetControls.
These are UI items like a button or listBox, however they are far more advanced. dotNetControls that you are likely to use
will be listView, treeView, button or maybe picturBox. You can see the usage of these controls in Max, the listView is used in
Layer Manger and treeView in Scene Explorer. Scene explorer is actually a combination of the two but this can't be done via Max script
only. C#, VB or some other language would have to be used to create the hybrid control and then called by Max.
There are several way to initialize a dotNet object. dotNetClass, dotNetObject, dotNetControl, dotNet.loadAssembly.
To which you should be using is a bit hard to explain, mostly because I don't fully understand it my self in all
cases at this point. There are some that do make sense like dotNetControl. Any time that you want to add a UI control
object to a tool that you are creating you will be using
Code:
dotNetControl internalScriptName "a dot net string defining the path to the control"
For more information about this consult the Max script help. Search for dotNet and there will be lots of information
about it.
Examples:
aColor = dotNetClass "system.drawing.color"
aPen = dotNetObject "system.drawing.pen" aColor 2
dotNetControl aList "system.windows.forms.listview"
dotNet.loadAssembly "system.xml"