Get handle code from selected 3D solid in DWF

Get handle code from selected 3D solid in DWF

Anonymous
Not applicable
428 Views
0 Replies
Message 1 of 1

Get handle code from selected 3D solid in DWF

Anonymous
Not applicable

Hi there

 

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..

 

I tried two code solutions as listed below but still can't get what I need.

 

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());
                   
                   
               }
           }  
        }


 

2016-04-29_052811.png

 

 

Object ID message box :

 

2016-04-29_052911.png

 

 

 

Object name and value :

 

2016-04-29_052924.png

 

Thanks in advance

0 Likes
429 Views
0 Replies
Replies (0)