Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import arcpy
- infc = "TestClass2"
- # Enter for loop for each feature
- #
- perimPntLst = []
- n = 1
- for row in arcpy.da.SearchCursor(infc, ["OID@", "SHAPE@"]):
- values = [row[0] for row in arcpy.da.SearchCursor(infc, "alternate")]
- alternate = set(values)
- # Alternate == 0 is False, 1 is True
- if alternate == 0:
- perimPntLst.append([row[1].firstPoint.X,row[1].firstPoint.Y,n])
- n = n + 1
- perimPntLst.append([row[1].lastPoint.X,row[1].lastPoint.Y,n])
- n = n + 1
- else:
- perimPntLst.append([row[1].lastPoint.X,row[1].lastPoint.Y,n])
- n = n + 1
- perimPntLst.append([row[1].firstPoint.X,row[1].firstPoint.Y,n])
- n = n + 1
- print perimPntLst
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement