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

Create list of unique and common layers from several dateframes

$
0
0
Hi guys,

When I try this line, it gives me all the layers of all dataframes,

Code:

uniquelyrs = []
            for df in arcpy.mapping.ListDataFrames(mxd):
                lyrs = arcpy.mapping.ListLayers(mxd, "", df)
                for lyr in lyrs :
                    if lyr not in uniquelyrs:
                        uniquelyrs.append(lyr)

Any tweeks around this?

Cheers

Viewing all articles
Browse latest Browse all 2485