i have created one python addin tool. which create some layers in Memory. at the end of the script it deletes the In memory layer. but such layer still remains in TOC with a broken link
how can i remove such layer in python ?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
There is property isBroken - Returns True if a layer's data source is broken.
for layer in arcpy.mapping.ListLayers(mxd, "*", df): if layer.isBroken: arcpy.mapping.RemoveLayer(df, layer)