How do I get a count of the selected features in a Layer using python?
use the getcountyou have to change the getcount result to an integer: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
or a string: 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 !!")