How to print and export maps in ArcPy?

How to print and export maps in ArcPy?

The new Arcpy.mapping module provides several functions that you can use to automate your routine print and export tasks. In this post we’ll examine Arcpy.mapping functions you can use for printing and exporting either maps from either the data or layout view in ArcMap.

Where do I find the mapdocument object in ArcGIS?

The MapDocument object provides access to most of the map document properties found in the Map Document Properties dialog box in ArcMap ( File > Map Document Properties ). The object also contains methods for managing map document thumbnails and methods for saving map documents that are found within the ArcMap File menu.

How does the arcpy.mapping scripting environment work?

Map documents that contain these layers will prompt the user to enter the appropriate information while the document is opening. The arcpy.mapping scripting environment will by default suppress these dialog boxes during execution, but that means that the layers will be treated as though they have broken data sources.

Which is the first object reference in ArcPy?

The MapDocument object is usually one of the first object references created in a map automation script because it is a required parameter for many of the arcpy.mapping functions.

What can I do with the ArcPy mapping module?

The arcpy.mapping module also provides functionality to identify service layers and swap them out for layers that point to local data and to export to a variety of formats, for example, PDF.

How to change arcpy.mapping to ArcGIS Pro?

The first and most obvious change is that arcpy.mp in ArcGIS Pro needs to reference a project file ( .aprx) rather than a map document ( .mxd ). Therefore, you need to replace arcpy.mapping.MapDocument (mxd_path) with arcpy.mp.ArcGISProject (aprx_path).

Do you need ArcPy to create a map series?

The arcpy package doesn’t provide functionality for creating the map series, but rather it facilitates the export of an existing map series. Therefore, you will need to create the map series using ArcGIS Pro, and then automate the export of the PDF file.