0

I ́m currently working in this project where we are creating a time wise analysis of a certain region with many areas of interest.

We are using the data driven pages tool to address the many AOIs but we are still missing the automation part of exporting each different map (each map is from a different date).

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Aug 6, 2015 at 2:20
4
  • 2
    Can you include a screen capture of the layer table to aid your question? Commented Aug 6, 2015 at 2:56
  • Here the Table of Contents: imgur.com/5pqxuRW Commented Aug 6, 2015 at 17:57
  • 1
    You will have to use arcpy/python to iterate through the ddp, associate the ddp page name to the image name loaded in the map, if ddp name == image name then turn on the image, and finally export the page. You can try this out in python and post another question if you get stumped. Commented Aug 6, 2015 at 21:24
  • Do you know any example that I could start with. Kind of a newbie here. Thanks a lot! Commented Aug 6, 2015 at 23:28

1 Answer 1

2

I just did this. Here is my code:

import arcpy
import os
for dirpath, dirnames, filenames in os.walk(u'R:\Projects\ERI\MXDs\DataDriven'): #Walks through folder containing many different Data Driven MXDs
 for filename in filenames:
 print filename
 basePath = "R:\Projects\ERI\MXDs\DataDriven"
 mxd = basePath + "\\" + filename
 field_name = "SSN"
 mxdFile = arcpy.mapping.MapDocument(mxd)
 for i in range(1, mxdFile.dataDrivenPages.pageCount + 1):
 mxdFile.dataDrivenPages.currentPageID = i
 row = mxdFile.dataDrivenPages.pageRow
 outpath = filename.replace(".mxd", "_" + row.getValue(field_name) + ".pdf") #Saves the file based on an attribute within the index layer.
 arcpy.mapping.ExportToPDF(mxdFile,r"R:\Projects\ERI\DataDriven_March2016\IndividualPDFs" + "\\" + outpath)
PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
answered May 26, 2016 at 16:03

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.