count = arcpy.GetCount_management("lyr") #Need min count for next tool if count > 5: print count arcpy.CollectEvents_stats("lyr", eventslyr)
count = int(str(arcpy.GetCount_management("lyr"))) #Need min count for next tool if count > 5: print count arcpy.CollectEvents_stats("lyr", eventslyr)
How do I get a count of the selected features in a Layer using python?
ALyr = arcpy.mapping.ListLayers(IMXD,"address_point")[0] arcpy.SelectLayerByAttribute_management(ILyr, "NEW_SELECTION", SheetQry) ## Test for slected address points NumS = str(arcpy.GetCount_management(ALyr)) Num = int(NumS) print Num
arcpy.SelectLayerByAttribute_management(ILyr, "NEW_SELECTION", SheetQry) Num = str(arcpy.GetCount_management(ILyr)) if Num == "0": arcpy.AddMessage("!! NO CORRESPONDING PLSS AREA EXISTS FOR THIS REQUEST !!")
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.