I have a template that contains two individual data frames amongst other elements. I am using a python script to populate this template, and for one of the dataframes I am using a json string to populate it with a map using the following code:
# Get the requested map document
templateMxd = os.path.join(templatePath, Layout_Template + '.mxd')
# Convert the WebMap to a map document
result = arcpy.mapping.ConvertWebMapToMapDocument(Web_Map_as_JSON, templateMxd)
mxd = result.mapDocument
#Get Titleblock Elements
# Note: ConvertWebMapToMapDocument renames the active dataframe in the template_mxd to "Webmap"
DataFrame = arcpy.mapping.ListDataFrames(mxd, 'Webmap')[0]
#get Scale
Scale = int(arcpy.GetParameterAsText(2))
DataFrame.scale = Scale
Now I need to populate the second dataframe with the same data as in the first, however I am having issues. The conversion process from json string to map document renames the active dataframe and saves the result within this dataframe. However I cannot set two dataframes as active at the same time. I have also tried to replicate the code but using the second dataframe name instead of the first however the second dataframe is still remaining blank.
Does anyone have any ideas how you can have two dataframes within the same template both containing the same map document populated using a python script for arcmap?