eInvalidLayer when setting LayerTableRecord.IsFrozen to false

Found this problem this morning: if you set IsFrozen to false on the current layer, you'll get an Autodesk.AutoCAD.Runtime.Exception with the ErrorStatus at eInvalidLayer. The setter is certainly checking if the layer is current to avoid freezing it, but it should test the value to ignore when it is false.

So you have to check the layer state before changing the property to false:

if (layer.IsFrozen) layer.IsFrozen = false;

Etiquettes:

Ajouter un commentaire