I want to clip rasters in data view using interactive rectangle (to define Area of Interest) and add them to current dataframe. Following is a piece of code which is not returning anything. Any suggestions to correct it would be appreciative:
import arcpy
import pythonaddins
def __init__(self):
self.enabled = True
self.cursor = 1
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
ras1 = arcpy.Clip_management(r"C:/temp/ras",
extent.XMin extent.YMin extent.XMax extent.YMax,
ras1, "#", "#", "NONE")
arcpy.RefreshActiveView()
return ras1