Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Need to find the command code for VBA programing

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Orest_iy
2093 Views, 2 Replies

Need to find the command code for VBA programing

Hello

I have created some custom button in VBA for Inventor.

I wold like create the Component Priority/Part Priority toggle buton.

By default the command located in contexy menu (SHIFT+Right click)

I cannot find the code for this command.

I need also advice about the literature about programing in VBA for Inventor.

Please help

Best regards,

Orest Yavtushenko

2 REPLIES 2
Message 2 of 3
pball
in reply to: Orest_iy

I have exactly what you need.

 

Here is a link to the full article on running commands using the api. http://modthemachine.typepad.com/my_weblog/2009/03/running-commands-using-the-api.html

 

'Turns on component priority
Run_CMD ("AppComponentPriorityWrapperCmd")
'Turns on part priority
Run_CMD ("AssemblyLeafPriorityCmd")


Function Run_CMD(ByVal cmd As String) As Boolean ' Get the CommandManager object. Dim oCommandMgr As CommandManager Set oCommandMgr = ThisApplication.CommandManager ' Get control definition for the line command. Dim oControlDef As ControlDefinition Set oControlDef = oCommandMgr.ControlDefinitions.Item(cmd) ' Execute the command. Call oControlDef.Execute End Function

 

I attached the full list of commands if you don't feel like using the code in the linked article to create your own. If you need any other selection options you'll just have to search the list for them.

Message 3 of 3
Orest_iy
in reply to: pball

Thank you!

Regards,

Orest

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

Post to forums  

Autodesk Design & Make Report