Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. import arcpy
  2.  
  3. infc = "TestClass2"
  4.  
  5. # Enter for loop for each feature
  6. #
  7. perimPntLst = []
  8. n = 1
  9. for row in arcpy.da.SearchCursor(infc, ["OID@", "SHAPE@"]):
  10. values = [row[0] for row in arcpy.da.SearchCursor(infc, "alternate")]
  11. alternate = set(values)
  12. # Alternate == 0 is False, 1 is True
  13. if alternate == 0:
  14. perimPntLst.append([row[1].firstPoint.X,row[1].firstPoint.Y,n])
  15. n = n + 1
  16. perimPntLst.append([row[1].lastPoint.X,row[1].lastPoint.Y,n])
  17. n = n + 1
  18. else:
  19. perimPntLst.append([row[1].lastPoint.X,row[1].lastPoint.Y,n])
  20. n = n + 1
  21. perimPntLst.append([row[1].firstPoint.X,row[1].firstPoint.Y,n])
  22. n = n + 1
  23. print perimPntLst
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement