I have a script that cycles through features based on attributes and makes a PDF centered around each feature. I would like to be able to include both a dynamic text element for the date as well as a title that is derived from the python script. I'm currently using the arcpy.mapping.ListLayoutElements(thisMap, "TEXT_ELEMENT") command and then updating the text element for each iteration of the loop. The problem is that not only does the title get changed but the dynamic date also gets changed to the text meant for the title. How would I construct the code to only target a specific text element instead of all of the text elements in the map? I have tried using the wildcard, but the problem with this is that the text gets changed from every previous iteration, so the wildcard will only identify the text from the first iteration.
with arcpy.da.SearchCursor(fc, ("SHAPE@", "UNIQUE_ID")) as searchCur: for row in searchCur: myDF.extent = row.extent myDF.scale = mapScale for elm in arcpy.mapping.ListLayoutElements(thisMap, "TEXT_ELEMENT"): elm.text = str(row) arcpy.RefreshActiveView() arcpy.mapping.ExportToPDF(thisMap, str(pdfLoc) + "\Map_" + str(row) + ".pdf", resolution=300, image_quality="Best") #***test output location variable structure arcpy.AddMessage("Output ---> Map_" + str(row) + ".pdf was created successfully!") arcpy.AddMessage(str(cycleCount) + "/" + str(recordCount)) cycleCount += 1