Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to enable / disable Add-In buttons / tools?

share|improve this question
up vote 2 down vote accepted

According to the documentation this can be done in the OnUpdate method, Add-in coding patterns

share|improve this answer
Perfect. Thanks. Just curious, if the OnUpdate method is likely checked often, how much impact does a code placed there have on performance? Suppose I am checking the state of the editor and enable/disable commands based on it. Where is the best place to declare the editor? If Editor is used throughout the Add-In, should I declare it once globally say in a module? – Jakub Nov 18 '10 at 13:58
@Jakub, the documentation states "Particularly time consuming operations, such as database queries, should never be performed within OnUpdate." So if you do checks of properties of objects in memory I don't think you will get in any problems. – MathiasWestin Nov 18 '10 at 15:30

I got that wrong the first time . Not sure why I was thinking checked when you said enabled.

But enabled is boolean just like checked:

Checked property.

For example, check out line #51 :[][1]


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.