4

Is there a way to batch export layouts in an ArcGIS Pro document to a specific format?

For example exporting all layouts to PDF in a file directory.

This was possible with multiple MXDs using python with Desktop, however I haven't found a way to do this with Pro.

3

As commented by @KHibma with respect to the listLayouts method of the APRX object:

Combine the 2 code samples (near the bottom) from here: http://pro.arcgis.com/en/pro-app/arcpy/mapping/layout-class.htm and you'll export all layouts in a project to PDF

3

This is what I use to do this. the print statement is completely unnecessary though, especially since this is run as a script tool in ArcGIS Pro.

import arcpy

aprx = arcpy.mp.ArcGISProject("CURRENT")
figFolder = arcpy.GetParameterAsText(0)

for lyt in aprx.listLayouts():
    print(" {0} ({1} x {2} {3})".format(lyt.name, lyt.pageHeight, lyt.pageWidth, lyt.pageUnits))
    lyt.exportToPDF(figFolder + "\\" + lyt.name + ".pdf")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.