Removing map from ArcGIS Pro project using ArcPy

847
2
06-17-2017 01:53 AM
Status: Open
Labels (1)
GraemeBrowning
Regular Contributor

I have a desirable requirement to be able to remove a map from an ArcGIS Pro project using ArcPy.

However the ArcGISProject class does not seem to provide a method to do this.

I would like ArcPy to be enhanced to allow this.

My use case is a map automation application where I need to maintain three maps to support three MGA Zones (Australian "equivalent" to supporting three UTM Zones).  When the application exports a PDF at the end I also save a copy of the APRX so that the user wanting the PDF can, if need be, open up a copy of the project that created it (think of it as a draft), and perform some modifications before saving a final project/PDF.  Since each PDF only uses one of the MGA Zone maps I would like to unclutter the project before saving the copy by removing the other two MGA Zone maps.

Tags (3)
2 Comments
TimothyBarnes

I also have a requirement to be able to remove Layouts from an aprx using Arcpy.mp. Arcpro has simplfied map templates as you can now keep all template variations of paper size/orientation in one project file. The draw back is that when requiring just one layout of many, there is no way in arcpy.mp to strip out the unneeded layouts from the project.

ThomasL

ArcGIS Pro 2.3 is very slow with multiple Maps (and Layouts). 

We need this feature in arcpy to enable us to write clean-up scripts to help ArcGIS Pro running.