I’m wondering what the use of Layers.Modify is-- it doesn’t seem to be necessary in this case, for instance (changing a layer’s color in python):
import System.Drawing as sd
from scriptcontext import doc
def add_layer(name,color):
myLayer = name
layerInd = doc.Layers.Find(myLayer,False)
if layerInd == -1:
layerInd= doc.Layers.Add(myLayer,color)
return layerInd
if __name__ == "__main__":
layerInd = add_layer("TEST",sd.Color.Black)
print layerInd
layer = doc.Layers[layerInd]
layer.Color = sd.Color.Lime
#doc.Layers.Modify(layer,layer.LayerIndex,True)
If you uncomment the last line the code will run just fine, but I’d like to know in what cases Modify is desirable.