Use inventors existing command icons in add-in

Use inventors existing command icons in add-in

matt_jlt
Collaborator Collaborator
880 Views
2 Replies
Message 1 of 3

Use inventors existing command icons in add-in

matt_jlt
Collaborator
Collaborator

Is there any way to use existing command icons in my addins for Inventor? I make my own icons for lots of commands but for some I would like to just re-use existing Inventor ones for some just because it's fast and easy.

 

Thanks, Matt.

 

0 Likes
Accepted solutions (1)
881 Views
2 Replies
Replies (2)
Message 2 of 3

YuhanZhang
Autodesk
Autodesk
Accepted solution

You can extract Inventor built-in icons using below sample, but good practice is to not use the built-in icons to make confusion to users, if you want to re-use Inventor built-in command controls in your own ribbon panels you can directly add them to your panels:

 

Sub ExtractBuiltInIconSample()
    Dim oDef1 As ButtonDefinition
    Set oDef1 = ThisApplication.CommandManager.ControlDefinitions.Item("PartFilletCmd")
    
    Dim oIcon As IPictureDisp
    Set oIcon = oDef1.LargeIcon
    
    StdFunctions.SavePicture oIcon, "C:\temp\Fillet.bmp"
End Sub


If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

Message 3 of 3

matt_jlt
Collaborator
Collaborator

Thanks for your help, much appreciated. The command I wanted to use is the view cube fixed distance one that doesn't have a ribbon button and is just from the view-cube context menu so I just wanted to use the view-cube icon to make it easy to identify and not have to waste time drawing up the icon.

 

Thanks, Matt.

0 Likes