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()
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.