MAXScript, .Net and casting objects

MAXScript, .Net and casting objects

Anonymous
Not applicable
410 Views
0 Replies
Message 1 of 1

MAXScript, .Net and casting objects

Anonymous
Not applicable
Hi

Does anyone know how I would cast a .Net object to a different type of .Net object in MAXScript?

For example, in my case I have a .Net function that returns an object of type System.Object, in my case I know that the object is actually a System.Windows.Forms.TreeNode, so I want to cast it to that type so I can then call System.Windows.Forms.TreeNode functions on the object. In C#, for example, I want to do something like this:

TreeNode draggedNode = (TreeNode)e.Data.GetData()

But in MAXScript I am left with:

draggedNode = e.Data.GetData()

Which means draggedNode is not a TreeNode and so I can't call TreeNode functions on it :(

Can anyone help me?

Thanks
Kevin
411 Views
0 Replies
Replies (0)