Looking for a script to help set a definition query for 4 MXD's (in different extents), refresh DDP, export as PDF and combine PDF in the order of the grid used for the DDP. Any help with the first, middle or last parts would be of great help.This is what I have so far, but it only gets me one MXD and no query.
import arcpy, os# `Create an output location variable`outDir = r"output location"# Create a new, empty pdf document in the specified output location folderfinalpdf_filename = outDir + r"\xx.pdf"if os.path.exists(finalpdf_filename): os.remove(finalpdf_filename)finalPdf = arcpy.mapping.PDFDocumentCreate(finalpdf_filename)# Add the title page to the pdffinalPdf.appendPages(r"Title PDF Location")# Export the Data Driven Pages to a temporary pdf and then add it to the# final pdf. Alternately, if your Data Driven Pages have already been# exported, simply append that document to the final pdf.mxdPath = r"MapLocation"tempMap = arcpy.mapping.MapDocument(mxdPath)tempDDP = tempMap.dataDrivenPagestemp_filename = r"C:\temp\MBExample\temp_pdfs\tempDDP.pdf"if os.path.exists(temp_filename): os.remove(temp_filename)tempDDP.exportToPDF(temp_filename, "ALL")finalPdf.appendPages(temp_filename)# Update the properties of the final pdffinalPdf.updateDocProperties(pdf_open_view="USE_THUMBS", pdf_layout="SINGLE_PAGE")# Save your resultfinalPdf.saveAndClose()
أكثر...
import arcpy, os# `Create an output location variable`outDir = r"output location"# Create a new, empty pdf document in the specified output location folderfinalpdf_filename = outDir + r"\xx.pdf"if os.path.exists(finalpdf_filename): os.remove(finalpdf_filename)finalPdf = arcpy.mapping.PDFDocumentCreate(finalpdf_filename)# Add the title page to the pdffinalPdf.appendPages(r"Title PDF Location")# Export the Data Driven Pages to a temporary pdf and then add it to the# final pdf. Alternately, if your Data Driven Pages have already been# exported, simply append that document to the final pdf.mxdPath = r"MapLocation"tempMap = arcpy.mapping.MapDocument(mxdPath)tempDDP = tempMap.dataDrivenPagestemp_filename = r"C:\temp\MBExample\temp_pdfs\tempDDP.pdf"if os.path.exists(temp_filename): os.remove(temp_filename)tempDDP.exportToPDF(temp_filename, "ALL")finalPdf.appendPages(temp_filename)# Update the properties of the final pdffinalPdf.updateDocProperties(pdf_open_view="USE_THUMBS", pdf_layout="SINGLE_PAGE")# Save your resultfinalPdf.saveAndClose()
أكثر...