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: 

Activate the "Master" view of a part

1 REPLY 1
SOLVED
Reply
Message 1 of 2
w.pepping
376 Views, 1 Reply

Activate the "Master" view of a part

I have a macro to change the thumbnails of a part, but my parts have not always the "Master view" active. 

How can I activate a view by code?

Get control of your sheet metal files.
Download the app from matprop.com
1 REPLY 1
Message 2 of 2

Could you try this sample code:

Sub Part_Switch2ViewMaster()
  Dim oDoc As PartDocument
  Set oDoc = ThisApplication.ActiveDocument
  
  Dim oDef As PartComponentDefinition
  Set oDef = oDoc.ComponentDefinition
  
  Dim oRepMgr As RepresentationsManager
  Set oRepMgr = oDef.RepresentationsManager
  
  Dim oViewReps As DesignViewRepresentations
  Set oViewReps = oRepMgr.DesignViewRepresentations
  
  Dim oView As DesignViewRepresentation
  Set oView = oRepMgr.ActiveDesignViewRepresentation
  MsgBox (oView.Name)
  
  Set oView = oViewReps.Item("Master")
  oView.Activate
  MsgBox (oView.Name)

End Sub

 cheers,


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

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

Post to forums  

Autodesk Design & Make Report