HOW TO

Batch-Export von Layouts in ArcGIS Pro

Last Published: July 12, 2024

Zusammenfassung

In ArcGIS Pro, a layout can be exported at the page size or clipped to the extent of the elements on the page. However, the Export Layout feature does not support batch exporting of layouts. This article provides the workflow to batch export layouts in ArcGIS Pro using Python, with the option to export the full layout or only the clipped extent.

Vorgehensweise

  1. In ArcGIS Pro, on the Insert tab, select New Notebook.
Add a new notebook to the ArcGIS Pro project by navigating to the Insert tab and in the Project group, select New Notebook.
  1. On the New Notebook tab, ensure the cell type is Code.
  2. In the cell's expression box, type the following codes. Replace <file path> with the destination folder path. Set the clip_to_elements parameter to 'True' to export the areas of the page that contains layout elements only instead of the whole layout. This is equivalent to the Clip to graphics extent function in the Export Layout feature. In this example, the parameter is set to 'False' to export the full layouts.
import arcpy,os

aprx = arcpy.mp.ArcGISProject("CURRENT")

for lyt in aprx.listLayouts():

  lyt.exportToPDF(os.path.join(r"<file path>", f"{lyt.name}"), clip_to_elements=False)
The Notebook in ArcGIS Pro containing the Python codes
Note:
The layouts can be exported as other file types by substituting 'exportToPDF' with other exportTo methods. Refer to ArcGIS Pro: Method Overview for the available methods.
  1. Click Run to execute the codes in the cell.
On the New Notebook tab, click the Run button to execute the code in the cell.
  1. The operation status is indicated on the upper-right corner of the New Notebook tab. A filled circle indicates the operation is running.
The filled circle on the upper-right corner of the New Notebook tab indicates that the operation is running in the notebook.

The image below demonstrates the layouts are exported to the destination folder after the operation is completed.

The layouts are exported as PDF files to the destination folder after the operation is completed.

Artikel-ID: 000026961

Benachrichtigungen erhalten und Lösungen für neue oder häufige Probleme finden

Unser neuer KI-Chatbot stellt zusammengefasste Antworten und Videolösungen für Sie bereit.

Esri Support App herunterladen

Zugehörige Informationen

Weitere Informationen zu diesem Thema erkunden

Unterstützung durch ArcGIS-Experten anfordern

An den technischen Support wenden

Esri Support App herunterladen

Zu Download-Optionen wechseln