Adding a picture to layout

Discussion created by jean584 on Mar 21, 2013
Latest reply on Mar 21, 2013 by LDanzinger-esristaff
I am automating a series of maps and would like to add a picture symbol to the layout.  I'm using Arc 10.1 if that makes a difference.  I am pretty new to Python and am having a difficult time figuring out the best way to go about this.  My approach was to add the picture element to the map template, which I called "Picture1", and then use the following code to update the element:

        elm = arcpy.mapping.ListLayoutElements(myMXD, "PICTURE_ELEMENT"):
            if = "Picture1":
                elm.sourceImage = r"C:\Pictures\Pic1.jpg"

I get the following error:
Parsing error SyntaxError: invalid syntax

Any ideas for what I'm doing wrong?  Eventually I need to make this more complicated (add multiple pictures, have them change depending on the map, etc.) so I'm trying to get the basic syntax down first.  Any help would be appreciated. Thanks!