AnsweredAssumed Answered

refreshing text element in python

Question asked by kschuett on Apr 21, 2015
Latest reply on Apr 22, 2015 by kschuett

I am sorry for asking I am sure someone has asked this but I can't seem to find the answer and i am new enough to arcmap and python I can't see my issue.....

 

So I am wanting to run a loop that changes a text element prior to being exported to .PNG

hourdriver = range(2)
for step in hourdriver:
    for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):
        if elm.name == "TIME_DESC":
            print "Found it"
            elm.text = "New Text"
            print elm.text # This results in "New Text" but on the map it stays as "TIME" which was the original text

mxd.save # I have tried save and refreshactiveiew at several points in the loop with no real result. 
arcpy.RefreshActiveView()

 

my print statements returns the correct text but the text element in the map does not update. as you can see i have tried saving and refreshing the active view.....  here is the print out put that I get

Found it
New Text
Found it
New Text

 

I was thinking about clone and delete but that seems like a strange way to go about refreshing a text element. Any help would be appreciated i am sure it is something simple i am missing. Thank you for your time.

Outcomes