1

Possible Duplicate:
How can I remove a feature layer in an Arcpy Script

This question could seem too stupid, but i'm struggling with it, and it cannot work.

I have an mxd file containing raster layers, and I would like to remove a layer. I don't know why it does not remove, it doesn't pop up any errors. I'm trying this code:

mxd = arcpy.mapping.MapDocument("photo.mxd")
df = arcpy.mapping.ListDataFrames(mxd)[0]

for i in arcpy.mapping.ListLayers(mxd , "TerraColor_SanFrancisco_US_15m.tif"):
    arcpy.mapping.RemoveLayer(df , i)

arcpy.RefreshActiveView()

Any help please.

geogeek
  • 4,566
  • 5
  • 35
  • 79

0 Answers0