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 ?
asked Feb 11, 2016 at 7:49
1 Answer 1
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)
answered Feb 11, 2016 at 8:21
-
isBroken Property is not workingAkhil Kumar– Akhil Kumar2016年02月11日 08:39:11 +00:00Commented Feb 11, 2016 at 8:39
-
is there any error or something?user7172– user71722016年02月11日 08:43:25 +00:00Commented Feb 11, 2016 at 8:43
-
apologies, i did something wrong in script, its working fine, thanks a lot.Akhil Kumar– Akhil Kumar2016年02月11日 08:57:29 +00:00Commented Feb 11, 2016 at 8:57
lang-py