custom button command

custom button command

Anonymous
Not applicable
591 Views
1 Reply
Message 1 of 2

custom button command

Anonymous
Not applicable

id like to know if it is possible to create a custom button with existing command  in inventor.

 

thanks

inventor 2011

vault 2012

0 Likes
592 Views
1 Reply
Reply (1)
Message 2 of 2

xiaodong_liang
Autodesk Support
Autodesk Support

Hi,

 

You can create your own buttons, please refer to the topic in API help document:

Ribbon User Interface Customization using the API >> ButtonDefinition

to know how a button works.

 

Then, in when the button is executed (clicked), you can call existing command by its internal name. .e.g.

 

  ThisApplication.ControlDefinitions("AppMeasureMomentCmd").Execute

 

this will execute the Measure Moment command. 

 

To get the commands you want to run, the following VBA code could be helpful. It dumps all existing commands.

 


Sub dumpCommands()

Dim oC As ControlDefinition
Open "c:\command.txt" For Output As #1

For Each oC In ThisApplication.CommandManager.ControlDefinitions
  Write #1, "[Display Name]: "; oC.DisplayName & "  [Inner Name]: " & oC.InternalName
Next
Close #1
End Sub

 

0 Likes