GISHydroNXT System Documentation
#*********************************************************************************
# Author: UMD
# Date: 24-07-2018
# Modified: n/a
# Classes: AddSubwatershedOutlets()
# Functions: n/a
# Modules: arcpy
# Comments: n/a
#*********************************************************************************
class AddSubwatershedOutlets(object):
"""Implementation for GISHydroNXT_addin.tool5 (Tool)"""
def __init__(self):
self.enabled = False
self.shape = 3
def onMouseDownMap(self, x, y, button, shift):
#*******************************************************************************************************
# a) check if "AddOutlets" raster exist then delete it if re-running tool
# b) add xy to "AddasOutlets.shp" recursively and convert it to a raster
#*******************************************************************************************************
arcpy.env.scratchWorkspace = scratchfolder
arcpy.env.workspace = optfolder
xy = (x,y)
cursor = arcpy.da.InsertCursor(optfolder + "/AddasOutlets.shp", ("SHAPE@XY"))
cursor.insertRow([xy])
arcpy.RefreshTOC()
arcpy.RefreshActiveView()
#*******************************************************************************************************
# Turn Add streams OFF and Delineate Subwatersheds ON
#*******************************************************************************************************
button7.enabled = True