change position of representation with shortcut

change position of representation with shortcut

skyngu
Collaborator Collaborator
840 Views
4 Replies
Message 1 of 5

change position of representation with shortcut

skyngu
Collaborator
Collaborator

hi all

is there any way that I can change position of represenations with shortcut on keyboard? I use mouse to select each position now. thanks

 

inventor 2013 sp2 64bit with window 7

Autodesk Inventor Professional 2019
0 Likes
Accepted solutions (1)
841 Views
4 Replies
Replies (4)
Message 2 of 5

adam.nagy
Autodesk Support
Autodesk Support

Hi,

 

You mean you want to switch to a specific positional representation inside the assembly through a shortcut?

 

If so, you could create a VBA macro and assing a shortcut to it in the Customize dialog:

Sub ChangeActiveDesignViewRepresentation()
    Dim doc As AssemblyDocument
    Set doc = ThisApplication.ActiveDocument
    
    Dim rm As RepresentationsManager
    Set rm = doc.ComponentDefinition.RepresentationsManager
    
    Call rm.PositionalRepresentations("Position1").Activate
End Sub

Cheers,



Adam Nagy
Autodesk Platform Services
0 Likes
Message 3 of 5

skyngu
Collaborator
Collaborator

no, i meant a shortcut to change position from one to another.

for example, there are poisiont1, position2, position3. when i use "crtl+n", it changes from position1 to position2, then to position3.

 

thanks.

Autodesk Inventor Professional 2019
0 Likes
Message 4 of 5

adam.nagy
Autodesk Support
Autodesk Support
Accepted solution

Hi,

 

You could do something like this then:

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

Cheers,



Adam Nagy
Autodesk Platform Services
Message 5 of 5

jR0sal3s
Advocate
Advocate

are you able to do some variation of this code so it works with specific posrep of a sub assembly..?

0 Likes