I'm trying to delete a Picture Element from 45 MXDs. This code is a start for me:
import arcpy
from arcpy import env
env.workspace = r"G:\PROJECTS\landuse\gis"
for mxdname in arcpy.ListFiles("*.mxd"):
mxd = arcpy.mapping.MapDocument(
r"G:\PROJECTS\landuse\gis\\" + mxdname)
for elm in arcpy.mapping.ListLayoutElements(mxd,"PICTURE_ELEMENT"):
if elm.name == "F:\GIS\practical_shapefile\notes\aer1_logo1.jpg":
elm.sourceImage =r"F:\GIS\practical_shapefile\general\esd_logo1.jpg"
mxd.save()
del mxd
I read:
- http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/listlayoutelements.htm
- http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/pictureelement-class.htm
but didn't find any hint how to do it.