class Calc(object): """Implementation for test_addin.button1 (Button)""" def __init__(self): self.enabled = False self.checked = False def onClick(self): """do something""" class process(object): """Implementation for test_addin.tool1 (Tool)""" def __init__(self): self.enabled = True self.cursor = 3 def onMouseDownMap(self, x, y, button, shift): """do something""" tool1.enabled = False button1.enabled = True
Solved! Go to Solution.
It's an optimization in the Add-In framework which makes less sense in Python than it does in C# Add-Ins: it only creates the objects when it needs them.
My response in this thread should give a workaround -- basically, it pre-initializes your button variables.