Quantcast
Channel: Manufacturing DevBlog
Viewing all articles
Browse latest Browse all 532

Switch to next representation

$
0
0

By Adam Nagy

I'm not aware of a way in the UI to switch to the next possible representation (e.g. positional representation) using a shortcut. However, you can assign a shortcut to a VBA macro which could do the switching.

Here is a code that switches to the next positional representation of the assembly:

Sub ActivateNextPositionalRepresentation()
    Dim doc As AssemblyDocument
    Set doc = ThisApplication.ActiveDocument
    Dim rm As RepresentationsManager
    Set rm = doc.ComponentDefinition.RepresentationsManager
    Dim prs As PositionalRepresentations
    Set prs = rm.PositionalRepresentations
    Dim index As Integer
    For index = 1 To prs.Count
        If rm.ActivePositionalRepresentation Is prs(index) Then Exit For
    Next
    index = index Mod prs.Count + 1
    Call prs(index).Activate
End Sub

Viewing all articles
Browse latest Browse all 532

Trending Articles