Select to view content in your preferred language

Create a new map in ArcGIS Pro with arcpy

14294
15
08-11-2017 12:57 PM
Status: Implemented
Labels (1)
RonnieRichards
Frequent Contributor

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. 

15 Comments
Bahram-Jomehzadeh

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()

 

JeffBarrette
Status changed to: In Product Plan

This is planned for Pro 3.1.  We have a new ArcGISProject.createMap() function.

 

Jeff - Layout and arcpy.mp teams

JeffBarrette

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.

Bahram-Jomehzadeh

There was a .0 left!

Just fixed the error! 

Sorry.😅
@JeffBarrette 

AmeliaBradshaw
Status changed to: Implemented

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.