Message 1 of 1
MAXScript, .Net and casting objects
Not applicable
07-10-2009
02:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
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