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
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.