[GIS] How to Set up Data Driven Pages using arcpy

arcpydata-driven-pages

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?

Best Answer

The right answer is you can't create or set up DataDrivenPages using arcpy at all. Most up-voted general answer to read documentation is helpful only to the point that you can find in it:

"The reverse is also true: map series can be completely scripted using arcpy.mapping without using the Data Driven Pages user interface in ArcMap, but there are good reasons for combining both techniques."

It might sound like you can create such object, right? Well you have to read more to get slapped:

"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."

If you look at the class itself, apart "currentPageID" the rest of few properties it has are Read Only. Few methods available will also not help you to set any property at all. The workaround is to program everything yourself without using data driven pages at all.

Related Question