# 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 ...
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.