Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inFeatures = "MyLayer"
- fields = ['x','y']
- # Add fields to your inFeatures
- for field in fields:
- arcpy.AddField_management(inFeatures,str(field),"DOUBLE")
- with arcpy.da.UpdateCursor(inFeatures, ('x','y',"shape@")) as cursor:
- for row in cursor:
- row[0] = row[2].firstPoint.X
- row[1] = row[2].lastPoint.X
- cursor.updateRow(row)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement