I found that this worked for me:
layers = arcpy.mapping.ListLayers(mxd)
for layer in layers:
desc = arcpy.Describe(layer)
selcount = desc.fidSet
if layer.name == "san_Wye":
print layer.name
if selcount <> "":
print "{0} features selected".format(len(desc.fidSet.split(';')))
if selcount == "":
print "no features selected"
dsc = arcpy.Describe("LayerName") selection_set = dsc.FIDSet if len(selection_set) == 0: # no feature is selected
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.