i am building a script, most of which i found on here, that exports my data driven pages as mxds. I need it to save the mxd by a specific attribute in the shapefile and am running into an error when trying with two attributes. It works with 1 attribute but i can't combine them.
import arcpy a = 'L_NAME' b = 'PAR_NUM' c = a + b mxd = arcpy.mapping.MapDocument(r"C:\Users\jcarl\Desktop\Presentation\P_Litwin.mxd") ddp = mxd.dataDrivenPages for pageNum in range(1, ddp.pageCount + 1): ddp.currentPageID = pageNum print "Saving %s.mxd" %(ddp.pageRow.getValue(c)) mxd.saveACopy(r"C:\Users\jcarl\Desktop\Presentation\MXD\\" + ddp.pageRow.getValue(c) + ".mxd") del mxd
like i said it works if i just use a, or b, but not together. I am trying to export as attribute (attribute).