Advertisement
Guest User

Untitled

a guest
Sep 15th, 2014
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. import arcpy
  2. n = arcpy.GetParameterAsText(3)
  3. origfc = arcpy.GetParameterAsText(4)
  4. fc = r"C:\temp\test.gdb\testFC" + n
  5. if arcpy.Exists(fc):
  6. arcpy.Delete_management(fc)
  7. arcpy.Copy_management(origfc,fc)
  8. arcpy.DeleteFeatures_management(origfc)
  9. fc2 = r"C:\temp\test.gdb\testFCcopy" + (n-1)
  10.  
  11. n > 0
  12. While True:
  13. if arcpy.Exists(fc2):
  14. arcpy.Delete_management(fc2)
  15. arcpy.Copy_management(fc,fc2)
  16. with arcpy.da.UpdateCursor(fc2, ["SHAPE@XY"]) as cursor:
  17. for row in cursor:
  18. cursor.updateRow([[row[0][0] + (arcpy.GetParameterAsText(0) or 0),
  19. row[0][1] + (arcpy.GetParameterAsText(1) or 0)]])
  20. n = n - 1
  21. fc = fc2
  22. fc2 = r"C:\temp\test.gdb\testFCcopy" + (n-1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement