If I just open ArcMap 10.1 and add the add-in via the Add-In Manager "Add From File", it does add the toolbar. However, it does not operate as a tool (I am expecting to interact with the map, where once clicked it stays depressed and I can move the cursor over the map. Similar to the Zoom tools). update: I can't even get an error to show (I have typed in an obviously incorrect line in the def_init below and have an open python window in ArcMap. You'd think it would throw an error when I run the tool, but nothing happens).here's the .py source:
import arcpy
import pythonaddins
class GrabExtents2ToolClass(object):
"""Implementation for GrabExtents2_addin.tool (Tool)"""
def __init__(self):
self.enabled = True
self.cursor = 3
self.shape = 'Rectangle'
def onMouseDown(self, x, y, button, shift):
pass
def onMouseDownMap(self, x, y, button, shift):
pass
def onMouseUp(self, x, y, button, shift):
pass
def onMouseUpMap(self, x, y, button, shift):
pass
def onMouseMove(self, x, y, button, shift):
pass
def onMouseMoveMap(self, x, y, button, shift):
pass
def onDblClick(self):
pass
def onKeyDown(self, keycode, shift):
pass
def onKeyUp(self, keycode, shift):
pass
def deactivate(self):
pass
def onCircle(self, circle_geometry):
pass
def onLine(self, line_geometry):
pass
def onRectangle(self, rectangle_geometry):
pythonaddins.MessageBox("Add-In executed!")