Is there a Python 3 example to export a Map Series in Pro 2.0.1?
Below is what I've used in python 2.0 . ArcMap 10.5 - is there something equivalent for Pro that will allow me to export all pages in a map series using Python?
mxdchs = arcpy.mapping.MapDocument(r"[PATH TO]\GRS_CHS.mxd") pageNameField = "GNumber" for pageNum in range(1, mxdchs.dataDrivenPages.pageCount + 1): mxdchs.dataDrivenPages.currentPageID = pageNum pageName = mxdchs.dataDrivenPages.pageRow.getValue(pageNameField) outEMF = outputfolderCHS + pageName + ".emf" arcpy.mapping.ExportToEMF(mxdchs,outEMF)
source: Combining Data Driven Pages with Python and arcpy.mapping | ArcGIS Blog
arcpy.mapping is now arcpy.mp
Too many things to decipher to provide a direct conversion, but you could get started in the arcpy documentation
I think this answers my question actually. Looks like you there is no Python way to export individual pages of a map series like there was in desktop..yet.
Looks like they added this:
The following script exports only the selected pages to a single, multipage PDF.
import arcpy, os, sys relpath = os.path.dirname(sys.argv) p = arcpy.mp.ArcGISProject(relpath + "\\MapSeries\\US_States.aprx") l = p.listLayouts() if not l.mapSeries is None: ms = l.mapSeries if ms.enabled: ms = l.mapSeries indexLyr = ms.indexLayer arcpy.SelectLayerByAttribute_management(indexLyr, 'NEW_SELECTION', "SUB_REGION = 'New England'") ms.exportToPDF(relpath + "\\Output\\Ex3_SelectedFeatures.pdf", 'SELECTED') MapSeries—ArcPy | ArcGIS Desktop