Select to view content in your preferred language

Custom Buttons for Custom Python Tools

167
0
10-04-2024 01:17 PM
Status: Open
Labels (1)
jvanlaan
Emerging Contributor

It would amazing if the custom Python toolbox in ArcGIS Pro would allow us to define one (or more) custom buttons for our Python tools. We could initialize our button in the tools init, or perhaps a getButtonInfo function could be added to the tool lifecycle. From there, we could return a button definition object that includes things likes button_text, button_icon (perhaps from a predefined list of icons), etc. Then an addition buttonClicked function could be added to the tool that accepts parameters, messages, and some reference to the button clicked (if more than one are allowed). This would allow us to wire up additional behaviors that we may want to occur before execution of a given tool. See attached screenshot for example taken from the a built-in sharing tool in ArcGIS Pro.