In Pro 2.0 it does not appear it is possible to create a new map within the project. Please consider adding a method to the ArcGISProject object with the ability to create a new map with a name from arcpy.
Alternatively a copy map method on the existing Map object would be a workable alternative
You can copy/paste maps manually in a project so this functionality seems like a necessary addition for additional project automation.
To @MaxSquires, and add a specific base map 😉
templateMxd = r"C:\ExportWebMapTemplates\A4 Portrait.mxd"
aprx = arcpy.mp.ArcGISProject("CURRENT")
map_list = ["map1", "map2", "map3"]
for m in map_list:
existing_maps = aprx.listMaps()
aprx.importDocument(templateMxd)
existing_maps_now = aprx.listMaps()
# not going to assume these maps are being added at any one index position
for ma in existing_maps_now:
if ma not in existing_maps:
# set the name of the imported map
ma.name = m
# add Streets Basemap
ma.addBasemap("streets")
# done adding new maps to aprx, save it
aprx.save()
This is planned for Pro 3.1. We have a new ArcGISProject.createMap() function.
Jeff - Layout and arcpy.mp teams
Bahram-Jomehzadeh WOW, how did you get that release? We are currently developing 3.1, 3.0 should be the current release. We won't change the status of this idea to "implemented" until 3.1 is released.
Jeff - layout and arcpy.mp teams.
This Idea has been implemented in ArcGIS Pro 3.1. Please see the What's New documentation for more new features in Pro 3.1.
The Ideas in ArcGIS Pro 3.1 blog will be wrapped up soon. Once complete, I will add the link to this comment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.