Select to view content in your preferred language

Exporting Thematic Map Series with arcpy.mp

161
1
11-12-2024 01:51 PM
Labels (1)
AdamDoyle
New Contributor

Wanted see see if anyone else had encountered this issue.

I have a python script setup for batch exporting layouts with a map series to PDF. I set it up on a new project  that uses thematic map series in a few layouts. When it hits one of these, it gets skipped. 

Here's a link to a support article with the a code example of how it normally works. (My script just has a little extra run through multiple layouts, and skip to the next if there's an error, but this is the part that matters)

https://support.esri.com/en-us/knowledge-base/export-map-series-000028089

So if a layout has a bookmark or spatial map series, you can run exportToPDF on the the layout's "mapSeries" object instead of the "layout" object (otherwise it just exports the first page).  

(At least for me) if the layout has a thematic map series, that "mapSeries" object is null, so ms.exportToPDF fails.

Looking at the documentation, there are separate objects for (spatial) MapSeries and BookmarkMapSeries,  but nothing mentioned for Thematic.  

https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/mapseries-class.htm

https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/bookmarkmapseries-class.htm

(I'm still on Pro 3.3x as of writing, but also didn't see this mentioned in the notes for 3.4)

 

 

 

 

1 Reply
SummerBailey-Kerber
New Contributor

I've just started looking into this as well. Would love to know if anyone has a working script for this using the new inbuilt Thematic Map Series.

 

My current script is based on the Layout Sample Code 2 https://pro.arcgis.com/en/pro-app/3.3/arcpy/mapping/layout-class.htm#C_GUID-6DFB661B-D50A-4E3A-AE75-... which will export one PDF but only the currently selected thematic map series rather than iterating though them all.

0 Kudos