Hi John,
Matthew and Stephen suggestions are right on track. Either using the Search Cursor, or the Get Count will be identical in performance. Example using Search Cursor:
mxd = arcpy.mapping.MapDocument(r"C:\Projects\\Municipality.mxd")
df = arcpy.mapping.ListDataFrames(mxd)[0]
list = []
with arcpy.da.SearchCursor(lyr, ["OID@"], "OBJECTID > 0") as cursor:
for row in cursor:
list.append(row[0])
del cursor
count = len(list)
if count == 0:
.....
del mxd
Example using Get Count:
mxd = arcpy.mapping.MapDocument(r"C:\Projects\Municipality.mxd")
df = arcpy.mapping.ListDataFrames(mxd)[0]
for lyr in arcpy.mapping.ListLayers(mxd, "*", df):
result = arcpy.GetCount_management(lyr)
count = int(result.getOutput(0))
if count == 0:
.....
del mxd