Save mapx file using python

1830
12
09-20-2019 08:02 AM
JohnSawicki1
New Contributor

I am looking to save some but not all of my  Maps in an ArcGIS Pro document as templates. I know I can save the layers out using python but can't find a way to save the "mapx" file using python. I am saving these pieces tp put them into source control. 

Thanks 

John 

0 Kudos
12 Replies
YurikoHashimoto2
New Contributor III

I am using ArcGIS Pro v2.5.1 and am unable to export a 'mapx' file form the console. When calling the method as described under the help documentation for 'Map'  with the line:

aprx = arcpy.mp.ArcGIS Project('CURRENT')

m = aprx.activeMap

m.exportToMAPX('Template.mapx')

I receive the following error:

Traceback (most recent call last):
File "<string>", line 3, in <module>
AttributeError: 'Map' object has no attribute 'exportToMAPX'

Any advice or redirection to resources would be much appreciated!

Tags (3)
0 Kudos
YurikoHashimoto2
New Contributor III

Similarly, I receive this error when attempting to export a layout to a PAGX file. 

AttributeError: 'Layout' object has no attribute 'exportToPAGX'

 

0 Kudos
PaulCleverleyArup
New Contributor II

I'm also getting "'Layout' object has no attribute 'exportToPAGX'"

Was there any resolution to this?

Thanks

Paul

0 Kudos