Select to view content in your preferred language

sort maps successively in the map frame

544
3
12-27-2021 01:20 AM
SalahAjjur
Occasional Contributor

Hello,

Is it possible to successively sort maps in the map frame instead of wasting the user's time looking for the map number? Please see the shot below.

Untitled.png

Thanks,

Salah

0 Kudos
3 Replies
JayantaPoddar
MVP Esteemed Contributor

The easiest way I can think of is to rename the initial map frames (Map1-Map9) as Map01, Map02, Map03, ..., Map09.

This will ensure all the maps are in order in the dropdown list.



Think Location
jcarlson
MVP Esteemed Contributor

Definitely the way to go. You may be able to quickly rename them all using a bit of arcpy and regex, too.

aprx = arcpy.mp.ArcGISProject("CURRENT")

for lyt in aprx.listLayouts():
    pad_name = re.sub(r'(?<=Map)(?=[1-9])(?![1-9])', '0', lyt.name)
    lyt.name = pad_name

 

- Josh Carlson
Kendall County GIS
0 Kudos
TomBole
Esri Regular Contributor

All, 

There is a known issue with the sorting of map frames - BUG-000138357 "Alphabetical sorting is not honored in the drop-down menu in the Format Map Frame pane".

Tom

0 Kudos