import os, sys import arcpy def main(): mxd = arcpy.mapping.MapDocument("CURRENT") df = mxd.activeDataFrame counter = 1 for lyr in arcpy.mapping.ListLayers(mxd, "", df): ext1 = lyr.getExtent() ext2 = lyr.getSelectedExtent() if not ext1 or ext1.equals(ext2): #no selection continue outfc = ''.join(('c:/temp/shapefile', str(counter), '.shp')) arcpy.CopyFeatures_management(lyr, outfc) counter += 1 if __name__ == '__main__': main()
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.