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
Solved! Go to Solution.
Solved by pball. Go to Solution.
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.