How do you set up data driven pages with ArcPy?

3576
4
12-04-2014 11:29 AM
BenjaminBauman
Occasional Contributor

Based on the lack of mention with in the documentation, as well the mention within this‌ gis.stackexchange thread, I'm getting the impression that it is not possible to set up data driven pages with ArcPy. This seems a little strange, seeing as how it is such a fundamental component of the Data Driven Pages toolbar. I am specifically trying to Enable Data Driven Pages, and then assigning it to a specific layer.

Tags (1)
0 Kudos
4 Replies
AmandaBishop
Occasional Contributor

Hello Benjamin,

I don't know much about ArcPy, but I am assuming you are coding this for a script to run automatically?  In the past, when I have set up data driven pages for an atlas book, I have had to add my specific layer first before setting up the pages.  Maybe try reversing the order you mentioned?  Try adding the specific layer and then pointing to the "enable data driven pages" code?  Just a thought.

Amanda

0 Kudos
BenjaminBauman
Occasional Contributor

Hi Amanda, I appreciate your help. It looks as if I can't do this after all. I found similar questions on the suggested threads section that answered my question. Thanks again.

DanPatterson_Retired
MVP Emeritus

It is quite simple to create a simple data driven page project and save it as a template.  Then you can ignore its limitations and continue the whole process using the arcpy.mapping module.  For example, the documentation beginning here will show you the python procedures within the module.  It is much the same way that you need a template to create a project in the first place...the principle applies here as well.  The capabilities of arcpy.mapping far surpass those of the ddp interface.

BenjaminBauman
Occasional Contributor

Thanks Dan. You made some good points. Setting up the template manually is pretty trivial.