Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Adding a picture to layout

$
0
0
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 elm.name = "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!

Viewing all articles
Browse latest Browse all 2485

Trending Articles