Inventor Customization

Inventor Customization

Reply
Distinguished Contributor
GeorgK
Posts: 138
Registered: ‎09-21-2006
Message 1 of 3 (196 Views)
Accepted Solution

Hide / Show all parts and assemblys

196 Views, 2 Replies
11-30-2012 02:03 AM

Hello together,

 

how could I use these functions "AssemblyAllVisibleDesignViewCmd" and "AssemblyAllInvisibleDesignViewCmd " to show and hide all parts?

 

Thank you

 

Georg

ADN Support Specialist
Vladimir.Ananyev
Posts: 475
Registered: ‎08-14-2012
Message 2 of 3 (168 Views)

Re: Hide / Show all parts and assemblys

12-04-2012 01:07 AM in reply to: GeorgK

You may use Commandmanager oblect to execute Inventor commands:

Sub Vis_1()
   Dim oControlDef As ControlDefinition
   Set oControlDef = ThisApplication.CommandManager _
     .ControlDefinitions.Item("AssemblyAllVisibleDesignViewCmd")
   oControlDef.Execute
End Sub

Pub Vis_2()
   Dim oControlDef As ControlDefinition
   Set oControlDef = ThisApplication.CommandManager _
     .ControlDefinitions.Item("AssemblyAllInvisibleDesignViewCmd")
   oControlDef.Execute
End Sub

 Both commands work only for selected design view representation.

 

Alternative approach is  the use of methods ShowAll and HideAll  of the object DesignViewRepresentation:

Sub Vis_3()

  Dim oAssyDoc As AssemblyDocument
  Set oAssyDoc = ThisApplication.ActiveDocument
  
  Dim oAssyDef As AssemblyComponentDefinition
  Set oAssyDef = oAssyDoc.ComponentDefinition
  
  Dim oMgr As RepresentationsManager
  Set oMgr = oAssyDef.RepresentationsManager
  
  Dim oViewRep As DesignViewRepresentation
  Set oViewRep = oMgr.ActiveDesignViewRepresentation
  
  oViewRep.ShowAll
'  oViewRep.HideAll

End Sub

Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Distinguished Contributor
GeorgK
Posts: 138
Registered: ‎09-21-2006
Message 3 of 3 (164 Views)

Re: Hide / Show all parts and assemblys

12-04-2012 02:41 AM in reply to: Vladimir.Ananyev

Thank you very much.

 

Georg

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.