Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

2 REPLIES 2
Reply
Message 1 of 3
thomas.henryAQXH5
218 Views, 2 Replies

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

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 !

 

2 REPLIES 2
Message 2 of 3
goyals
in reply to: thomas.henryAQXH5

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
Message 3 of 3

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

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report