How to list layer present in a .lyr

1011
4
09-09-2014 10:39 PM
PierreWeisse
New Contributor

Hello,

I work in a folder containing about 250 .lyr

I wish i could list the layers contained in each of .lyr

I don't know if it's possible ?

Has anybody any idea

Thank you for your help

Reply
0 Kudos
4 Replies
AsrujitSengupta
Regular Contributor III

ListLayers (arcpy.mapping)

ArcGIS Help 10.1

NaimeCelik
Occasional Contributor

import os

Path=r'C.......'

list=([m for m in os.listdir(Path) if m.endswith('.lyr') and os.path.isfile(os.path.join(Path, m))])

DanPatterson_Retired
MVP Esteemed Contributor

If you are interested in layers within layers as well, please see the recent post and script in my recent blog post.  The script also allows for the production of a text file containing the folder's layer information.

Layer information in folders

PierreWeisse
New Contributor

Thank you very much Dan

Reply
0 Kudos