I need to come up with a Python code to automate a map creation process but I am a little bit of lack of python knowledge. Any help would be much appreciated. My problem is that I have a 20 mxd file which need an update process in timely manner(this is just one project) and pdf creation for each mxd then appended pdfs. At the moment, I have a tool which creates map index shape file for at the layout view for each mxd.

I want to :

  1. Loop through the index shape file's attribute (first one in the table of contents)

  2. Select or zoom into first row then

     -get mxd name from attribute table(its available in attribute table)
     -specify the destinatin folder to save the mxd(i think that I can get that in attribute table as well) or specify it in the code.
     -save mxd to specified location
     -specify the destinatin folder to save the pdf file
     -save pdf to specified location
  3. Move to next row and do the same process in step 2

  4. When reached the last row append all pdf files created into same locaition as pdfs
  5. Close
  • 4
    It may be a good idea to split your question. – Pablo Dec 20 '12 at 19:01
  • 1
    Probably you need to learn some basics in Python. ArcPy is easy to use. Arcpy.mapping module is part, where you should start. – Tomek Dec 20 '12 at 19:03
  • 1
    Hi, welcome. This question should really be split into to several questions. The PDF is secondary. Stack Exchange will help with that unless you are using ArcMap. Also are you using ArcMap? You said mdx and usually this is the case. Is any part of this question spatially related, you just said table and attributes, but you mentioned zooming. Are you familiar with dialogues (is this where the destination folder is being chosen), these different when using ArcMap or just straight python. – user13395 Dec 20 '12 at 19:04

Here are some resources to get better with Python and ArcGIS.


ArcPy recipes


Here is the ESRI tutorial for arcpy.mapping:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.