I've got a weird problem. My addin throws problems intermittently where it doesn't recognize buttons or tools when I try to toggle the visibility in my code. It seems as though the objects aren't instantiated as trying to toggle them works after I try to interact with them. What is the problem and how do I begin to debug it? My code is far too long to post but if there's something I can provide to help can you let me know?
Here's a scenario:
User starts Arc and clicks a button. The button tries to enable another button with:
anotherButton.enabled = False
Arc throws an error:
global variable "anotherButton" not defined.
User clicks on "anotherButton" and then tries the first button again. This time the command executes and "anotherButton" is disabled.