Inventor Customization

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

Hide / Show all parts and assemblys

182 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: 458
Registered: ‎08-14-2012
Message 2 of 3 (154 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: 125
Registered: ‎09-21-2006
Message 3 of 3 (150 Views)

Re: Hide / Show all parts and assemblys

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

Thank you very much.

 

Georg

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

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 to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube