Community
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?
Solved! Go to Solution.
Solved by Vladimir.Ananyev. Go to Solution.
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,