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.
I am only getting following error:
Python: NameError: global name 'button1' is not defined
So it appears as though the Calc class does not exist. What does dir(YourAddinIn_addin) tell you? Can you run the .py file on its own from python.exe without syntax errors?