I created a template in Arcmap with 2 data frames. I then added my layers to both data frames(There is likely a more efficient way to do this, but since I was only using 10 layers I did it this way). In the python script I used the web map as json format to fake a webmap in. I then used the ConvertWebMapToMapDocument tool to create a print.
Web_Map_as_JSON = {
"mapOptions": {
"extent": {
"xmin": -121.2525,
"ymin": 47.3671,
"xmax": -122.8498,
"ymax": 46.7341,
"spatialReference": {
"wkid": 2927,
"latestWkid": 2927
}
},
},
"operationalLayers": [],
"baseMap": {
"title": "cartoRoads",
"baseMapLayers": [
{
"id": "cartoRoads_1751",
"layerType": "ArcGISTiledMapServiceLayer",
"url": "",
"visibility": true,
"opacity": 1,
"title": "cartoRoads"
}
]
},
"exportOptions":{},
"layoutOptions":{},
"authoringApp": "WebMapViewer",
"authoringAppVersion": "6.2",
"version": "2.12",
"applicationProperties": {
"viewing": {
"routing": {
"enabled": true
},
"measure": {
"enabled": true
},
"basemapGallery": {
"enabled": true
}
}
}
}
###The webmap_as_json parameter isn't really that important if you're using your own template.
templateMxd = (r'\\'filePATH'\TestLayout.mxd')
result = arcpy.mapping.ConvertWebMapToMapDocument(Web_Map_as_JSON, templateMxd)
mxd = result.mapDocument
ImgLayer1 = sys.argv[1]#(This is simply the name of the layer sent as a string)
ImgLayer2 = sys.argv[2]
ImgLayer3 = sys.argv[3]
ExtentInYMax = sys.argv[4]
ExtentInYMin = sys.argv[5]
ExtentInXMax = sys.argv[6]
ExtentInXMin = sys.argv[7]
df1 = arcpy.mapping.ListDataFrames(mxd)[1]
newExtent = df1.extent
newExtent.XMin, newExtent.YMin = ExtentInXMin, ExtentInYMin
newExtent.XMax, newExtent.YMax = ExtentInXMax, ExtentInYMax
df1.extent = newExtent
layers1= ListLayers(df1)
for layer in layers1:
restLayer = "rest - "+layer.name;
if restLayer == ImgLayer1:
layer.visible = True
You can then turn layers on/off(Or add them from an outside location if possible), change extent etc. of each dataframe.