I have a arcgis pro project that has 3 layouts each is references (linked or whatever the terminology may be) to one of the 3 maps that this project also have.
I tried to write code that uses a for loop to loop over the layout names and over the map name that associated to each layout. code below.
However i am able to get a list of all layouts and print that list of strings (keysList) but the map names that link to them is not returning. I read there a MapFrame element within a layout object that to my understanding contains the map name (among other elements, but I don't find how to call it and loop over it to access this attribute.
Any help is appriciates.
import arcpy
keysList = []
valuesList = []
aprx = arcpy.mp.ArcGISProject("CURRENT")
for lyt in aprx.listLayouts():
for m in lyt.listElements():
keysList.append(lyt.name)
valuesList.append(m.name)
print(keysList)
print(valuesList)