Select to view content in your preferred language

MapSeries - exporting multiple files via arcpy

936
1
06-25-2019 06:07 PM
IceCreamBean
Emerging Contributor

Have a ArcGIS Pro project with multiple layouts and mapseries, I'm trying to write a script that will allow you to specify a layout and range and export the corresponding maps as a PDF.

import arcpy.mp
arcpy.env.overwriteOutput = True

#project
aprx = arcpy.mp.ArcGISProject(r"D:\Project.aprx")

#choose mapseries, range and output folder
MapSeriesCurrent = 'MS1'
MapSeriesRange = '1-5'
Output = r"D:\Users\JoeBloggs"

#export map series as PDF
for lyt in aprx.listLayouts():
    ms = lyt.mapSeries
    if MapSeriesCurrent in lyt.name and ms.enabled:
               ms.exportToPDF(Output+"\\Map","RANGE",MapSeriesRange,"PDF_MULTIPLE_FILES_PAGE_NAME",resolution=300)

This script works fine - except for the multiple_files parameter ("PDF_MULTIPLE_FILES_PAGE_NAME"). When I remove that the script produces the pdfs as expected in single file but once I add that parameter there is no output or error message.

I've checked the MapSeries in the project and they have set Name and Sort Fields,changing to PDF_MULTIPLE_FILES_PAGE_NUMBER doesn't work either. 

Any suggestions?

Tags (2)
0 Kudos
1 Reply
TimothyMcKinney
Occasional Contributor

@IceCreamBean I seem to be getting the same error. Any luck with this?

0 Kudos