Select to view content in your preferred language

Best way to update mxds to a new layout template with arcpy?

2694
2
08-07-2015 10:43 AM
IanMurray
Frequent Contributor

Alright GeoNet I need some input on a project.

I have 2400 or so map documents that all followed an old style template that was being used for our map documents.  We have devised a new template that have some different layout elements than the last one(PictureElements instead of some GraphicElements or MapSurroundElements), which all the old map documents should be moved over to.  There was an automated process for generating the maps, but even with the automation all the maps would need some edits and tweaks, so thats 2400 maps to re-edit if I just reproduce them using the script with the new templates.  Since I really don't want to hand edit some 2400 documents again, wanted some input on how best to accomplish this.

The easiest way to handle this would be if I could: A.) Add new layout elements with python to the existing map documents, but thats not possible without ArcObjects as I recall, or B.) If I could copy layout elements from one map document to another, which again I don't believe is possible(please let me know if so).

Since I think neither of those options are available, would it be best to use the access the new templates via python then just copy the dataframes from the existing map documents, copying the existing extents, and re-doing the other elements that stay the same on the each map, then saving these new map documents?  Does this sound like a good way to proceed, or does anyone know of any other good solutions for something like this?

Thanks in advance!

Ian

0 Kudos
2 Replies
DarrenWiens2
MVP Honored Contributor

Depending on how extensive the changes are, you may want to look into using ArcObjects through Python/comtypes. Be warned: it is a serious brain-shift from arcpy, but may be worth your effort.

Can you copy data frames with arcpy? I didn't think that was possible, but I'm not overly familiar with the mapping module.

IanMurray
Frequent Contributor

The changes are fairly minor, just a new title bar thats a picture element now instead of a graphic element and map surround element, and the dataframe x,y locations have been adjusted slightly.

I'm actually not sure if you can copy dataframes, but I could just copy all the layers and add them to the other map document dataframe.

0 Kudos