Move Features

Discussion created by jsmith0705 on Oct 8, 2013
Latest reply on Oct 10, 2013 by jsmith0705
I am attempting to select features within ArcMap, run the script, and move the selected features by a distance entered.  I am attempting to recreate the Editor Move Tool and the wheel.  I read through the documentation;  http://resources.arcgis.com/en/help/main/10.1/index.html#//01m80000000s000000.  But, the documetation dos not provide a script example.  I was thinking something along the lines of the following script.  An attribute error exists on the line reading, ext = lyr.extent.  I tried including a layer in the ListLayers function, but that did not solve the error. 

mxd = arcpy.mapping.MapDocument ("CURRENT")
df = arcpy.mapping.ListDataFrames (mxd)[0]
lyr = arcpy.mapping.ListLayers(mxd, df)

EW = arcpy.GetParameter(0)
NS = arcpy.GetParameter(1)

#orig extent
ext = lyr.extent
ext.XMin += EW
ext.XMax += EW
ext.YMin += NS
ext.YMax += NS
#new extent
lyr.extent = ext