Using PythonWin gives me the following error.
NameError: name 'shift_features' is not defined. Below is the code that I used.
import arcpy
in_features = r"C:/Temp/CP_C06.shp"
x_shift = 100
y_shift = 100
shift_features(in_features, x-shift, y_shift)
def shift_features (in_features, x_shift=None, y_shift=None):
with arcpy.da.UpdateCursor(in_features, ['SHAPE@XY']) as cursor:
for row in cursor:
cursor.updateRow([[row[0][0] + (x_shift or 0),
row[0][1] + (y_shift or 0)]])
return