Select to view content in your preferred language

Generate List of Map Layers in ArcGIS Pro 3.2?

1380
5
04-12-2024 11:57 AM
jchester73
Regular Contributor

In Pro 3.2 is there a way to export a list of map layers and their layer groups? Or is Python the only way? Would like to export in order to review with others to make changes to a web map.

0 Kudos
5 Replies
DanPatterson
MVP Esteemed Contributor

python

ArcGISProject—ArcGIS Pro | Documentation

with listMaps, then

Map—ArcGIS Pro | Documentation

with listLayers

and so on

 


... sort of retired...
0 Kudos
Robert_LeClair
Esri Notable Contributor

To get a list of map views in your ArcGIS Pro project, you can use the Python code here in this Esri Community post.

To get a list of all data sources used in an ArcGIS Pro project, you can use the Python code here from the GIS Stack Exchange.

Maybe there's a way to combine the 2 scripts into 1 script.  Not sure as I'm not a Python user.

0 Kudos
jchester73
Regular Contributor

I was able to generate a simple list with script below. Group layers were also listed as layers at the beginning of each set. Copied into Word then manually highlighted the headings. Nice if this were just a built in feature in Pro...

import arcpy
aprx = arcpy.mp.ArcGISProject("CURRENT")
m = aprx.listMaps("Map_Name")[0]
for lyr in m.listLayers():
print(lyr.name)

0 Kudos
Robert_LeClair
Esri Notable Contributor

You may want to consider creating an ArcGIS Idea for this item.  The more kudos it receives the more attention it may get from the ArcGIS Pro developers!

0 Kudos
FabioPerea
New Contributor

My hero!!!