I have this layer structure in ArcMap:

enter image description here

"Localities, Gazeteers, Bases, Regions, and Territorial Claims are all Group Layers. All others under these are layers. I have a script that uses the Arcpy Describe method to go under each layer and get its full directory path. Here is the script:

import arcpy
for dataframe in dataframes:
    for lyr in arcpy.mapping.ListLayers(mxd, "", dataframe):
        if not lyr.isGroupLayer:    

This would return something like: C:/Folder/Subfolder/layer.shp Now, I am trying to figure out a way to get the path of each layer relative to the map. For example, for layer "features_multipoint", I need the script to report something like this:


The Describe method seems to not provide such capabilities.

1 Answer 1


Try lyr.longName

longName (Read Only)

This property is valuable when trying to determine whether a layer belongs to a group layer. If a layer does not belong to a group layer, the long name will equal the layer name. If a layer does belong to a group layer, the group layer structure will be included in the long name. For example, the name of a layer nested inside a group layer within another group layer may look something like Group1\Group2\LayerName. All layer types support this property.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.