I have a question regarding selections in ArcGIS for Desktop. Assumed I have one layer in ArcMap and I have selected two of five features.
Is it possible to get a list of all selected features by using Python?
It would be fine if there is a way to get one special (or all) attribute(s) of the selected features stored in a list that can be written into a txt file.
Is it possible to do this in ArcGIS for Desktop?
Answer
Any time you have a selection on a layer a cursor object will only return the selected rows.
for row in arcpy.SearchCursor("name_of_layer_with_selection"):
print row.field1, row.field2
No comments:
Post a Comment