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.
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.
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.
We've encountered a bug when working on a scripting tool that has created multiple maps that are not visible in the catalog but listed when trying to export the APRX. Without an arcpy module to delete the added map packages and not having them visible in the catalog we are unable to delete the added maps.
I am interested in this functionality as well. My use case is trying to interrogate mxd files from ArcPro using the importDocument method. So far I have not found a way to access arcpy.mp properties without first importing the map to a project. I can import mxds just fine but there doesn't seem to be a way to programmatically get rid of them when desired after bringing them into the project.
We hope to include a number of project item management functions (e.g., Delete, Copy, Add folder connections, database connections ,etc).
@JeffBarrette That is great to hear! Removing and adding folder and database connections from a project would be so useful. All I seem to able to do at the moment is change the defaults
Any idea if this is coming soon??
We started to prototype removing project items recently. Our current plan it to support this at Pro 3.1.
Jeff - Layout and arcpy.mp teams
@JeffBarrette Thank you for taking the time to reply and keeping us informed. That's excellent news. I look forward to it!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.