Example #1
0
        private void AddGraphNodeToTree(AcDb.GraphNode graphNode, TreeNode parentTreeNode)
        {
            // TBD: for some reason, these are returning GraphNodes, not XrefGraphNodes
            string name = "*UNNAMED*";
            AcDb.XrefGraphNode xNode = graphNode as AcDb.XrefGraphNode;
            if (xNode != null)
                name = xNode.Name;

            TreeNode newTreeNode = new TreeNode(name);
            newTreeNode.Tag = graphNode;
            parentTreeNode.Nodes.Add(newTreeNode);

            for (int i=0; i<graphNode.NumOut; i++) {
                AddGraphNodeToTree(graphNode.Out(i), newTreeNode);
            }
        }
Example #2
0
        protected void TreeNodeSelected(object sender, System.Windows.Forms.TreeViewEventArgs e)
        {
            m_curObj = e.Node.Tag;

            AcDb.GraphNode gNode = m_curObj as AcDb.GraphNode;
            if (gNode != null) {
                m_snoopCollector.Collect(gNode);
                Snoop.Utils.Display(m_lvData, m_snoopCollector);
                return;
            }

            AcDb.Graph graph = m_curObj as AcDb.Graph;
            if (graph != null) {
                m_snoopCollector.Collect(graph);
                Snoop.Utils.Display(m_lvData, m_snoopCollector);
                return;
            }
        }