Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I've read a lot about the topic data driven pages. I'm writing a python script for ArcGIS and I've defined my stripmap using the arcpy.StripMapIndexFeatures_cartography command and now I have to set up Data Driven Pages with all the parameters it needs. My only problem is that I cannot understand how to do this. Is there a specific command in the arcpy library or a specific workaround to do this?

Thanks in advance, Annalisa

share|improve this question

2 Answers 2

If you have not already gone through the ESRI arcpy.mapping tutorials and ArcGIS Resources pages, they have heaps of sample scripts to comb through. I would suggest looking at these first:

Tutorials:

If you are using 10.0, you can find similar help topics for it on the 10.0 help site.

share|improve this answer
    
Hi Ryan, and thanks for answering.. my exact problem is that the tutorial itself says: "Data Driven Pages must first be enabled and authored within a map document (.mxd) using the Data Driven Pages toolbar in ArcMap before it can be referenced with arcpy.mapping." –  Annalisa Minelli Oct 7 '12 at 14:43
    
well.. now I'm trying to write a script to automatize everything - but I cannot - from how it seems. And maybe now I will be forced to stop my script at a certain point and say the user: "please, open the ddp setup and set this parameter in this way - this other in this way.." which is near horrible to me. But it seems there's no other way if I can't ENABLE data driven pages from arcpy, or arcpy.mapping.. or wahtever it is :( –  Annalisa Minelli Oct 7 '12 at 14:46

You can largely avoid opening the reference mxd by using layers. This is generally how arcpy.mapping operates anyways, is through layer files.

For example, I have used a workflow which looks something like this:

  • arcpy.MakeFeatureLayer_management - here is where you can subset the data
  • arcpy.SaveToLayerFile_management
  • arcpy.mapping.UpdateLayer - allows you to switch out an existing layer in the mxd with the one you have created for your needs
  • arcpy.mapping.DataDrivenPages.refresh()
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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