I'm writing an AutoCAD Plug-in that shows all the entities as Nodes in a TreeView. I want to be able to get the object from the Node to be able to work with programmatically. This is my code for when a node is clicked:
private void treeView1_MouseClick(object sender, MouseEventArgs e)
{
TreeNode node = treeView1.SelectedNode;
propertyGrid1.SelectedObject = node;
/*Entity selectedEntity = node.getObject() as Entity; Pseudo-code, need to know how to do this*/
}
TreeNode has a Tag property that's designed to allow you to associate an object with a Node.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With