I have problem with my script. Layers are in one geodatabase, and have names like: orne1942, orne 2003, orne 2009 (the same forpart e.g. orne). Script should changing symbology layers wich have the same forpart (uniform it) in many map documents (.mxd). Mayby someone have idea what I am doing wrong ? (I am just begning my python adventure.... )
my script:
import arcpy
path = (r"C:\program2_D.Nowak\map\\")
arcpy.env.workspace=path
arcpy.env.overwriteOutput=True
orneWZOR=arcpy.mapping.Layer(r"C:\program2_D.Nowak\orneWZOR.lyr")
for mapDoc in arcpy.ListFiles("*.mxd"):
print mapDoc
mxd=arcpy.mapping.MapDocument(path + mapDoc)
print mxd
df=arcpy.mapping.ListDataFrames(mxd, "*")[0]
for df in arcpy.mapping.ListDataFrames(mxd):
orne=arcpy.mapping.ListLayers(mxd, "orne*", df)[0]
arcpy.mapping.UpdateLayer(df, orne, orneWZOR)
mxd.save()
print "done"
del mxd
del lasyWZOR, drogiWZOR, orneWZOR, odlogowaneWZOR, zabudowaneWZOR, laki_pastwiskaWZOR <