import arcpy import pythonaddins class ButtonClass1(object): """Implementation for TirolerV02_addin.btn1 (Button)""" def __init__(self): self.enabled = True self.checked = False def onClick(self): # Starts Hailtool Dialog print "Hailtool started" pythonaddins.GPToolDialog("C:\\BW_Workspace\\Toolbox_BW_V02\\Toolbox_BW.tbx", "HagelSchadensableitung") class ButtonClass2(object): """Implementation for TirolerV02_addin.btn2 (Button)""" def __init__(self): self.enabled = True self.checked = False def onClick(self): print "hi" pass class ToolClass1(object): """Implementation for TirolerV02_addin.tool1 (Tool)""" def __init__(self): self.enabled = True self.cursors = 3 self.shape = 'Rectangle' def onRectangle(self, rectangle_geometry): """Occurs when the rectangle is drawn and the mouse button is released. The rectangle is a extent object.""" extent = rectangle_geometry # Create a fishnet with 10 rows and 10 columns. if arcpy.Exists(r'in_memory\fishnet'): arcpy.Delete_management(r'in_memory\fishnet') fishnet = arcpy.CreateFishnet_management(r'in_memory\fishnet', '%f %f' %(extent.XMin, extent.YMin), '%f %f' %(extent.XMin, extent.YMax), 0, 0, 10, 10, '%f %f' %(extent.XMax, extent.YMax),'NO_LABELS', '%f %f %f %f' %(extent.XMin, extent.YMin, extent.XMax, extent.YMax), 'POLYGON') arcpy.RefreshActiveView() return fishnet
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.