Select to view content in your preferred language

Is there an onUpdate function for the python add-in module so that I can toggle a button state (enable/disable) based on defined parameters, like a feature layer having one selected feature?

399
0
04-27-2018 06:20 AM
BryanTaylor
Emerging Contributor

I have added a toolbar and a button using python add-in assistant (arcmap 10.4).  I would like the button to be enable, if and only if, one particular layer (named operations) has exactly one feature selected.  I can easily use the __init__ function of the button to test if these circumstances are met at runtime.  If they are, the button is enabled, if they are not, the button is disabled.  Now, I can't seem to locate any help finding if there is an onUpdate function that can "look" for changes and test to see if the right conditions are met and enable or disable the button appropriately?  Is there a listener function/method that I can use to update the button when there are any selection changes that take place within the loaded layer(s)?

0 Kudos
0 Replies