<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Get handle code from selected 3D solid in DWF in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/get-handle-code-from-selected-3d-solid-in-dwf/m-p/6302093#M36187</link>
    <description>&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to get the handle code from a 3D solid object, also I want to get some properties for the object like layer name, color, etc..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried two code solutions as listed below but still can't get what I need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;private ECompositeViewer.IAdECompositeViewer CompositeViewer;

        private ECompositeViewer.IAdSection Section;
        private AdCommon.IAdCollection MyObjects, MyObjectProperties;
        private AdCommon.IAdUserCollection MyObjectsNamedCollection;
        private ECompositeViewer.IAdContent ObjectContent;
       
private void axCExpressViewerControl1_OnSelectObjectEx(object sender,AxExpressViewerDll.IAdViewerEvents_OnSelectObjectExEvent e)
        {
            Get_Handle_Code();
        }

        void Get_Handle_Code()
        {
            
            CompositeViewer = (ECompositeViewer.IAdECompositeViewer)axCExpressViewerControl1.ECompositeViewer; Section = (ECompositeViewer.IAdSection)CompositeViewer.Section;
            ObjectContent = (ECompositeViewer.IAdContent)Section.Content;
            MyObjectsNamedCollection = (AdCommon.IAdUserCollection)ObjectContent.CreateUserCollection();
            MyObjects = (AdCommon.IAdCollection)ObjectContent.get_Objects(1); //0 is to return all objects

           foreach (ECompositeViewer.IAdObject MyObject in MyObjects)
           {
               AdCommon.IAdObject2 obj = (AdCommon.IAdObject2)MyObject;
               MessageBox.Show("Object ID is  " + obj.Id.ToString());

               
               MyObjectProperties = (AdCommon.IAdCollection) MyObject.Properties;
               foreach (AdCommon.IAdProperty MyObjectProperty in MyObjectProperties)	
               {
                   MessageBox.Show(MyObjectProperty.Name.ToString() + " / " + MyObjectProperty.Value.ToString());
                   
                   
               }
           }  
        }

&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/235867iB605D530430C9643/image-size/medium?v=v2&amp;amp;px=400" alt="2016-04-29_052811.png" title="2016-04-29_052811.png" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Object ID message box :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/235866iE5536645A8784C3B/image-size/medium?v=v2&amp;amp;px=400" alt="2016-04-29_052911.png" title="2016-04-29_052911.png" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Object name and value :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/235869i19942F3FFBA463B1/image-size/original?v=v2&amp;amp;px=-1" alt="2016-04-29_052924.png" title="2016-04-29_052924.png" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Sat, 30 Apr 2016 21:24:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-04-30T21:24:10Z</dc:date>
    <item>
      <title>Get handle code from selected 3D solid in DWF</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-handle-code-from-selected-3d-solid-in-dwf/m-p/6302093#M36187</link>
      <description>&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to get the handle code from a 3D solid object, also I want to get some properties for the object like layer name, color, etc..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried two code solutions as listed below but still can't get what I need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;private ECompositeViewer.IAdECompositeViewer CompositeViewer;

        private ECompositeViewer.IAdSection Section;
        private AdCommon.IAdCollection MyObjects, MyObjectProperties;
        private AdCommon.IAdUserCollection MyObjectsNamedCollection;
        private ECompositeViewer.IAdContent ObjectContent;
       
private void axCExpressViewerControl1_OnSelectObjectEx(object sender,AxExpressViewerDll.IAdViewerEvents_OnSelectObjectExEvent e)
        {
            Get_Handle_Code();
        }

        void Get_Handle_Code()
        {
            
            CompositeViewer = (ECompositeViewer.IAdECompositeViewer)axCExpressViewerControl1.ECompositeViewer; Section = (ECompositeViewer.IAdSection)CompositeViewer.Section;
            ObjectContent = (ECompositeViewer.IAdContent)Section.Content;
            MyObjectsNamedCollection = (AdCommon.IAdUserCollection)ObjectContent.CreateUserCollection();
            MyObjects = (AdCommon.IAdCollection)ObjectContent.get_Objects(1); //0 is to return all objects

           foreach (ECompositeViewer.IAdObject MyObject in MyObjects)
           {
               AdCommon.IAdObject2 obj = (AdCommon.IAdObject2)MyObject;
               MessageBox.Show("Object ID is  " + obj.Id.ToString());

               
               MyObjectProperties = (AdCommon.IAdCollection) MyObject.Properties;
               foreach (AdCommon.IAdProperty MyObjectProperty in MyObjectProperties)	
               {
                   MessageBox.Show(MyObjectProperty.Name.ToString() + " / " + MyObjectProperty.Value.ToString());
                   
                   
               }
           }  
        }

&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/235867iB605D530430C9643/image-size/medium?v=v2&amp;amp;px=400" alt="2016-04-29_052811.png" title="2016-04-29_052811.png" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Object ID message box :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/235866iE5536645A8784C3B/image-size/medium?v=v2&amp;amp;px=400" alt="2016-04-29_052911.png" title="2016-04-29_052911.png" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Object name and value :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/235869i19942F3FFBA463B1/image-size/original?v=v2&amp;amp;px=-1" alt="2016-04-29_052924.png" title="2016-04-29_052924.png" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Sat, 30 Apr 2016 21:24:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-handle-code-from-selected-3d-solid-in-dwf/m-p/6302093#M36187</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-30T21:24:10Z</dc:date>
    </item>
  </channel>
</rss>

