Command Input Table For Dummies

Command Input Table For Dummies

therealsamchaney
Advocate Advocate
275 Views
1 Reply
Message 1 of 2

Command Input Table For Dummies

therealsamchaney
Advocate
Advocate

Hi all,

I've been getting into Fusion 360 Scripts API and making some headway but one thing that's still pretty confusing is the Command Input tables. I can use the ui.inputBox just fine. However when it comes to command input tables, it seems like there is a boatload of confusing boilerplate that you need to write just to make it work. The only example script that uses them is over 300 lines long!

For instance, you have to make a bunch of custom child classes of adsk.core.CommandCreatedEventHandler and adsk.core.CommandEventHandler, and it seems like they are usually called things like MyCommandCreatedHandler, MyExecuteHandler, MyCommandDestroyHandler

What the heck is all that stuff and why do we have to write it all? I would think a simple user input dialogue box with a few options would be much more straightforward.

Can anyone put into plain English what these classes are and why we need them? What is a Command Created Event Handler and how is it different from just a Command Event Handler (without the Command) or what is an Execute Handler or a Command Destroy handler?

Lastly, what is the bare minimum of code needed to make a user input command table dialogue box?

I've used python a lot and I have a good understanding of classes and inheritance, and I do know what event handlers are in general (something that watches for some trigger then does something when that happens) but I just don't know the specifics of these ones.

Any help in clarifying these things would be greatly appreciated. 

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

BrianEkins
Mentor
Mentor

You should start by reading these two topics on Commands and Command Inputs.

 

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-3922697A-7BF1-4799-9A5B-C8539DF57051

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-8B9041D5-75CC-4515-B4BB-4CF2CD5BC359

 

Hopefully that will answer most of your questions and whatever is left you can come back here.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com