dsc = arcpy.Describe("LayerName") selection_set = dsc.FIDSet if len(selection_set) == 0: # no feature is selected
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"
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und vieles mehr. Neu hier? Erstelle ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.