Hello All,
I apologize if this question has been asked a dozen times. I have done a ton of research, but I feel like I am still in the rabbit hole. I am trying to create a Map Book using ArcGIS Pro and python. My goal is to iterate through my index layer, zoom to selection, export that selection to a PDF, and then append all those individual maps to a PDF.
The way I am tackling this issue is to create GRID first, which is the code below:
#Part 1: Create Grid
#Import System Modules
import arcpy
from arcpy import env
#Set environment settings
arcpy.env.workspace = "C:\data\"
#Set local variables
outputFC = "Map Index"
inputFC "Sanborn_1920_AllBldgs"
polygonWidth = "139.2 meters"
polygonHeight = "153.7 meters"
numberRows = "3"
numberColumns = "5"
startingPageNum = "5"
#Execute GridIndex Features
arcpy.cartography.GRIDIndexFeatures(outputFC, inputFC, "INTERSECTFEATURE", "NO_USEPAGEUNIT", None, polyonWidth, polygonHeight, "", "", 3, 5, 7, "NO_LABELFROMORIGIN")
My next step is to loop through my table of contents, zoom to each selection, and make it its own map, and that is where I get confused. Does it make sense to use def zoom_export or arcpy.mapping module?
Solved! Go to Solution.
Were you able to find the PDFDocument class help which includes a sample on how to append PDFs together?
https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/pdfdocument-class.htm
Jeff - arcpy.mp and Layout teams
ArcGIS Pro doesn't have arcpy.mapping, I assume you mean arcpy.mp.
Seems to me rather than custom coding everything, you would be wise to use the Map Series functionality. Do you really need to automate the tile generation in Python? In my experience you usually want to tweak the map tile polygons before generating a map book.
Sorry for the late reply. My goal was to create a custom script, but I am running into too many holes, so I am using Map Series and then tweaking my code to add my title page, Table of Content page, and overview pages.
Were you able to find the PDFDocument class help which includes a sample on how to append PDFs together?
https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/pdfdocument-class.htm
Jeff - arcpy.mp and Layout teams
Yes, thank you. The document was really helpful.