Executing a Panel "dropdown" list item

Executing a Panel "dropdown" list item

isocam
Collaborator Collaborator
468 Views
1 Reply
Message 1 of 2

Executing a Panel "dropdown" list item

isocam
Collaborator
Collaborator

Can anybody help?

 

I have created a toolbar, using a Fusion 360 Python script, that has 4 separate dropdown options.

 

Please see the attached txt file for the code that I am using to create the toolbar.

 

How can I run the code associated with each dropdown item?

 

For example,

 

The first dropdown item is called "Configure".

 

For testing purposes only, I want to show a messagebox saying "You have selected "Configure" when I manually select it from the dropdown list.

 

Many thanks in advance!

 

Darren

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

zxynine
Enthusiast
Enthusiast

Your command definition object you got when you created the button definition is what you use to first start handling events. The def has a commandCreated event you will assign a handler to which will fire whenever the user selects that button. See this page on info for command definitions. You seem to be newer to commands in the api, so i highly suggest reading through the documentation as itll help a ton. Heres the page on events which should get you started with that.

0 Likes