Can someone tell me why I am getting this value error when attempting to access the Montreal.tif layer object?
The first three lines access the object and set the transparency perfectly well, but when I attempt to access it using the following 4 lines I get the illustrated ValueError?
I need the second method since the b variable (Montreal) will change.
ArcGIS Desktop v10.1, ArcInfo license.
The following is a successful workaround (among others), but I'm still not sure why the above was giving me an error?
mxd = arcpy.mapping.MapDocument("Current")
df = arcpy.mapping.ListDataFrames(mxd)[0]
b = "Montreal"
for lyr in arcpy.mapping.ListLayers(mxd, "", df):
if "{0}.tif".format(b) in lyr.name:
lyr.transparency = 50