2

I have an ArcPy script below to export a map book to PDF. The index layer are forty acre boundaries (township and range quarter sections). The data in the mxd is on an oracle database and updated nightly.
I want to use task manager to run the script nightly but I would like to add code so that only mxd's with edits/changes to the data in its geographic extent from the previous days version will export.
The reason for this is there are approximately 12,000 of these boundaries and it takes about 21 hours to run. I am hoping to dramatically reduce that. Here is the code:

import arcpy
arcpy.env.overwriteOutput = True
mxd = arcpy.mapping.MapDocument(r"C:\SamplePath\SampleMXD.mxd")
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
  mxd.dataDrivenPages.currentPageID = pageNum
  pageName = mxd.dataDrivenPages.pageRow.FORTYAC
  arcpy.mapping.ExportToPDF(mxd, r"C:\SamplePath\SampleFileName_" + str(pageName) + ".pdf")
del mxd
0

1 Answer 1

2

As was mentioned in the comments, a solution would be to enable editor tracking on all of your data. This will automatically add timestamps to every record of the data to say when it was modified last.

Then use a definition query on your data to narrow it down to only the features that changed since the last export. Use this queried subset of data to select the index polygons (frames) of the map series that need to be re-exported (since they contain data that has changed).

This subset of index polygons can then be used to rebuild the map series or you could turn it into a list of page numbers and only export the page numbers that you have identified.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.