ArcGIS Pro 2.1.1, python 3.6.2
I have a standalone python script which cycles through multiple map extents and exports each as seperate PDF files. However, currently the PDFs are exported as FILENAME_[Page Number].pdf. I want it to be FILENAME_[Page Name].pdf
Is it as simple as replacing 'ms.currentPageNumber' and 'pageNum' with 'ms.currentPageName' and 'pageNam'? (if those even exists!)
I guess the {0} would also need to disappearin the last line, as there won't be any page number in the file name.
import arcpy, os, sys
relpath = os.path.dirname(sys.argv[0])
p = arcpy.mp.ArcGISProject("C:\\Automation\\Automation.aprx")
print ("project located")
l = p.listLayouts()[0]
print ("layouts listed")
if not l.mapSeries is None:
ms = l.mapSeries
if ms.enabled:
for pageNum in range(1, ms.pageCount + 1):
ms.currentPageNumber = pageNum
print("Exporting page {0} of {1}".format(str(ms.currentPageNumber), str(ms.pageCount)))
l.exportToPDF("C:\\Users\\Default\\Production\\Completed_certificates\\FILENAME_{0}".format(str(ms.currentPageNumber) + ".pdf"))
replacing all ms.currentPageNumber instances with ms.currentPageName doesn't work, as the latter doesn't exist within arcpy python 3.6.2
In Pro, under Map series
Methods getPageNumberFromName(page_name)
Properties
currentPageNumber—Read/Write; Long
pageNameField—Read-only; GP Field object ### try the Field object if so defined
yeah I noticed those, but I don't know how to use them or where to implement them in my script...