import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
mxd.dataDrivenPages.currentPageID = pageNum
pageID = mxd.dataDrivenPages.getPageIDFromName("PARCEL_NO")
arcpy.mapping.ExportToJPEG(mxd, r"P:\Township Maps\Bloomingdale\JPEG" + pageName + ".jpeg", resolution=100)
del mxd
import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
mxd.dataDrivenPages.currentPageID = pageNum
fieldValue = mxd.dataDrivenPages.pageRow.PARCEL_NO
fieldValue = str(fieldValue)
arcpy.mapping.ExportToJPEG(mxd, r"P:\Township Maps\Bloomingdale\JPEG" + fieldValue + ".jpeg", resolution=100)
del mxd
Thanks for the discussion on this! And thank you Joel Calhoun, pageRow fixed my situation perfectly. ![]()
import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
mxd.dataDrivenPages.currentPageID = pageNum
pageID = mxd.dataDrivenPages.getPageIDFromName("PARCEL_NO")
arcpy.mapping.ExportToJPEG(mxd, r"P:\Township Maps\Bloomingdale\JPEG" + "\" + pageID + ".jpeg", resolution=100)
del mxd
getPageIDFromName (page_name)
Parameter Explanation Data Type
page_name A value in the index layer that corresponds to the Name field that was used to set up Data Driven Pages
String
Many of the Data Driven Pages properties and methods use an internal index value rather than the literal names of the pages used to create the index layer. The index values are automatically generated based on the Name and Sort fields. It may not be obvious which index value represents a specific page. The getPageIDFromName method provides a mechanism for this translation.
pageID = mxd.dataDrivenPages.getPageIDFromName("HarborView")
mxd.dataDrivenPages.currentPageID = pageID