Draw polygon with GUI

المشرف العام

Administrator
طاقم الإدارة
I'm looking to make a python add in tool for arcmap to draw a polygon. Eventually I want the tool to also calculate the area and a bunch of other things but for now I would be happy just drawing an irregular polygon by clicking the mouse for each vertex and double clicking to close. Anyone have a template of what that would look like as I'm horrible at coding?

The genericode produced by the add in wizzard gives the following:

class ToolClass3(object):"""Implementation for Test Addin_addin.tool (Tool)"""def __init__(self): self.enabled = True self.shape = "NONE" # Can set to "Line", "Circle" or "Rectangle" for interactive shape drawing and to activate the onLine/Polygon/Circle event sinks.def onMouseDown(self, x, y, button, shift): passdef onMouseDownMap(self, x, y, button, shift): passdef onMouseUp(self, x, y, button, shift): passdef onMouseUpMap(self, x, y, button, shift): passdef onMouseMove(self, x, y, button, shift): passdef onMouseMoveMap(self, x, y, button, shift): passdef onDblClick(self): passdef onKeyDown(self, keycode, shift): passdef onKeyUp(self, keycode, shift): passdef deactivate(self): passdef onCircle(self, circle_geometry): passdef onLine(self, line_geometry): passdef onRectangle(self, rectangle_geometry): pass

أكثر...
 
أعلى