Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import arcpy
- n = arcpy.GetParameterAsText(3)
- origfc = arcpy.GetParameterAsText(4)
- fc = r"C:\temp\test.gdb\testFC" + n
- if arcpy.Exists(fc):
- arcpy.Delete_management(fc)
- arcpy.Copy_management(origfc,fc)
- arcpy.DeleteFeatures_management(origfc)
- fc2 = r"C:\temp\test.gdb\testFCcopy" + (n-1)
- n > 0
- While True:
- if arcpy.Exists(fc2):
- arcpy.Delete_management(fc2)
- arcpy.Copy_management(fc,fc2)
- with arcpy.da.UpdateCursor(fc2, ["SHAPE@XY"]) as cursor:
- for row in cursor:
- cursor.updateRow([[row[0][0] + (arcpy.GetParameterAsText(0) or 0),
- row[0][1] + (arcpy.GetParameterAsText(1) or 0)]])
- n = n - 1
- fc = fc2
- fc2 = r"C:\temp\test.gdb\testFCcopy" + (n-1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement