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: 

Shortcut key for component visibility

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
DRoam
2309 Views, 3 Replies

Shortcut key for component visibility

I'd like to set up a keyboard shortcut so that when I press the 'V' key, inventor toggles the visibility of the selected part or assembly. However, "Visibility" seems to be about the only command that doesn't exist in the list of keyboard shortcuts*. I found this post in which someone says it's not possible, but might be using VBA. I've done some iLogic but know nothing about Inventor's inner-working VBA. I'm wondering if there's some workaround, VBA or otherwise, that'll allow me to toggle visibility using the 'V' key. Any suggestions would be appreciated. Thanks!

 

*actually it does but it says it's only available for use in Inventor Studio. Go figure.

 

 

Using: Autodesk Inventor 2013 Product Design Suite

3 REPLIES 3
Message 2 of 4
adam.nagy
in reply to: DRoam

Hi,

 

You could create a VBA command like this:

Sub ToggleVisibility()
    Dim ss As SelectSet
    Set ss = ThisApplication.ActiveDocument.SelectSet
    
    Dim obj As Object
    For Each obj In ss
        If TypeOf obj Is ComponentOccurrence Then
            Dim occ As ComponentOccurrence
            Set occ = obj
            
            occ.Visible = Not occ.Visible
        End If
    Next
End Sub

And then assign the V key to it in the "Customize" dialog (right-click anywhere on the Ribbon and select "Customize User Commands")

customize.png

As you can see in my case there are two commands already using that shortcut, so when I press 'V', I will have to select which command should run:

vshortcut.png 

 

I hope this helps.

 

Cheers,



Adam Nagy
Autodesk Platform Services
Message 3 of 4
DRoam
in reply to: adam.nagy

That works perfectly, thanks so much!

Message 4 of 4
dusan.naus.trz
in reply to: DRoam

this is super, I also thanks so much adam.nagy. I work in version 2014, and I think that is not even in version 2016.

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

Post to forums  

Autodesk Design & Make Report