cgarlock

Trying to change elementWidth

Discussion created by cgarlock on Mar 25, 2013
Latest reply on Mar 28, 2013 by jbarrette-esristaff
Hi

I'm using the following code:

import arcpy
mxd = arcpy.mapping.MapDocument(r"C:\Courtney\TEST.mxd")
for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):
    if elm.name == "author":
        elm.text = '<dyn type="document" property="author"/>'
        elmWidth = 2.5
        elm.elementPositionX = 3.23
        elm.elementPositionY = 8.54
        print elmWidth

prints 2.5
     
The script runs fine but when I open the mxd the xy position is changed but not the elmWidth, is there another way to change
element width bc I've tried it a bunch of times and nothing works.

Also is there a better script to add title, author, dataframe time to the layout without having to set each xy position and element width?

Thank you

Outcomes