2

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.

Is it possible to do so by any other means from ArcPy?

asked Jun 1, 2017 at 1:57
0

2 Answers 2

2

I have submitted an ArcGIS Idea for this:

Removing map from ArcGIS Pro project using ArcPy:

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.

answered Jun 17, 2017 at 8:57
0
1

This was implemented in 3.1 and ArcPy can now delete a map from an ArcGIS Pro project as follows:

found_maps = aprx.listMaps(map_name)
if len(found_maps):
 aprx.deleteItem(found_maps[0])

It works for me.

answered Jul 25 at 3:25

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.