Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Save lyr-files from multiple files of the table of contents

$
0
0
Hallo,

I would like to save lyr-files from multiple Features in the table of contents.

This works:

PHP Code:

import arcpy
mxd 
arcpy.mapping.MapDocument("CURRENT")
for 
lyr in arcpy.mapping.ListLayers(mxd):
    
lyr.saveACopy(lyr.name ".lyr"

It includes files in groups but unfortunately also the group names themselves.
Is it possible to avoid that lyrs are made from the groupname, but only from the content of the group?

Further, it is possible to exclude certain layers / layergroups?

Would be very kind if you could help me out with some code-snippets?

Yours,

Matthias

Viewing all articles
Browse latest Browse all 2485

Trending Articles