#prints a list of the selected layers in the TOC along with the number of selected records mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd)[0] for lyr in arcpy.mapping.ListLayers(df): selectedCount = len([int(fid) for fid in arcpy.Describe(lyr).fidset.split(";") if fid != '']) if selectedCount > 0: print "The " + str(lyr) + " layer has " + str(selectedCount) + " records 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.