Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Hide / Show all parts and assemblys

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
GeorgK
531 Views, 2 Replies

Hide / Show all parts and assemblys

Hello together,

 

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

 

Thank you

 

Georg

2 REPLIES 2
Message 2 of 3
Vladimir.Ananyev
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

Message 3 of 3
GeorgK
in reply to: Vladimir.Ananyev

Thank you very much.

 

Georg

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report