Problem with arcpy.mapping Title and Legend

Discussion created by bgeoca on Mar 8, 2011
Latest reply on Mar 8, 2011 by JScheirer-esristaff
Hi Every body
I am new at python and I have problem adding a title and legend to the layout by arcpy.mapping.
I tried ESRI's samples which where too complicated (Specifically the Legend Example!) and I could not add the legend a simple title to map!
Could you please let me know how i can do this?
I also need to know how I can resize or position the data frame in map layout.

I used this code to create title which didn't add any thing
import arcpy
mxd = arcpy.mapping.MapDocument(r"C:\Test\Map.mxd")
#search for ???Title Block??? and if found move to desired location
for elm in arcpy.mapping.ListLayoutElements(mxd, "GRAPHIC_ELEMENT"):
if == "My Map":
elm.elementPositionX = 4.75
elm.elementPositionY = 10.5
del mxd