I am trying to create a text label for a series of maps over time. I have a text box with the element name "DateBox" in my mxd. As a filler, it says "Week # here". I want to it say "Week XX", where XX refers to the week number. I am using arcgis 10.3.
I have tried:
import arcpy from arcpy import env env.workspace = r"C:\Users\GIS_User\Output" map_mxd = arcpy.mapping.MapDocument(r"C:\Users\GIS_User\Output\timelapse.mxd") for XX in range(1,121): for TextElement in arcpy.mapping.ListLayoutElements(map_mxd, "TEXT_ELEMENT"): if TextElementName == "DateBox": TextElement.text = 'Week ' + str(XX) print TextElement.text
The arcpy window in ArcMap prints the text and shows that it successfully loops from Week 1 to Week 120. However, this change is not reflected in the textbox of the map document. The textbox itself still holds my original filler text "Week # here" and shows no changes when I run this code.