CommandDefiniton.execute(input) - How does it work ?

CommandDefiniton.execute(input) - How does it work ?

Anonymous
Not applicable
550 Views
2 Replies
Message 1 of 3

CommandDefiniton.execute(input) - How does it work ?

Anonymous
Not applicable

Hi everyone, 

 

First of all I apologize if this has already been asked somewhere, but I have not been able to find any information on this anywhere. 

 

I am trying to understand how the CommandDefinition.execute(input) works, especially the input part. 

 

More specifically, it would be very interesting for me to run the following:

 

move_command = ui.commandDefinitions.itemById('FusionMoveCommand')

move_command.execute()

 

and passing inputs in the execute of the move command such move type, pivot point coordinates, X, Y, Z, X angle, Y angle, Z angle etc... but have not figured out a way to do it. 

 

If someone has experience with this, any help is gladly welcomed. 

 

Cheers !

 

551 Views
2 Replies
Replies (2)
Message 2 of 3

goyals
Autodesk
Autodesk

As explained in documentation of this method, this is the same as the user clicking a button that is associated with this command definition. There is no documentation available which can you let you know what all parameters that command takes. In my opinion it is mainly meant to execute the commands which takes no input. For example If you want to shut down fusion from add-in, you can use below script.

 

app = adsk.core.Application.get()
ui = app.userInterface
cmdDef = ui.commandDefinitions.itemById(‘ExitApplicationCommand’)
context = adsk.core.NamedValues.create()
cmdDef.execute(context) (



Shyam Goyal
Sr. Software Dev. Manager
0 Likes
Message 3 of 3

knightsAHN63
Participant
Participant

I am also struggling with this! More examples would be greatly appreciated.

0 Likes