<?xml encoding=”UTF-8″>It’s worth downloading existing apps from the Fusion 360 exchange store even just to see if they already implement a certain functionality that you are interested in. In which case you can look at the source code (if it’s a JavaScript or Python add-in) and see how things are done.
E.g. the ExactFlat add-in creates its own toolbar panel and promotes its single button control to that panel.
It’s done using this part of the Python code:
# "toolbarControlPanel_" is the button control added to the panel
toolbarControlPanel_.isPromoted = True
toolbarControlPanel_.isPromotedByDefault = True
isPromoted = True will make the control show up on the panel – just like when clicking the curved arrow (Add to toolbar) on a control in a panel menu:
But if the user clicks Reset Panel Customization on the given panel or Reset All Toolbar Customization anywhere on the toolbar then the button will disappear from the panel.
isPromotedByDefault = True will make sure that the button stays on the panel even if the toolbar is reset using either of the above mentioned ways.




Leave a Reply