# Import arcpy module import arcpy #Layer that have already a selection ans some feature highlighted : layerName = "PARCELS" # first way to count selected features rows = arcpy.SearchCursor(layerName) i = 0 for row in rows: i=i+1 # second way to count selected features d = arcpy.Describe(layerName) fids = d.FIDSet #print results : arcpy.AddMessage("loop count : " + str(i)) arcpy.AddMessage("desc count : " + str(len(fids.split(";"))))
2 diffrent solutions for only selected features but not the highlighted ones : # Import arcpy module import arcpy #Layer that have already a selection ans some feature highlighted : layerName = "PARCELS" # first way to count selected features rows = arcpy.SearchCursor(layerName) i = 0 for row in rows: i=i+1 # second way to count selected features d = arcpy.Describe(layerName) fids = d.FIDSet #print results : arcpy.AddMessage("loop count : " + str(i)) arcpy.AddMessage("desc count : " + str(len(fids.split(";"))))But I need to get only the highlighted ones ...
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.