Set property 'isModified' does not work

From that earlier topic, myDiagram.isModified - #2 by walter :

As long as a transaction is ongoing or an undo has been done, .isModified will be true. When the transaction is completed or it is fully redone, .isModified will automatically become false.

Also, from Diagram | GoJS API :

Gets or sets whether this Diagram’s state has been modified. Setting this property does not notify about any changed event, but it does raise the “Modified” DiagramEvent, although perhaps not immediately.

Returns true if the Diagram has been changed, if the undoManager has recorded any changes, or if an undo has been performed without a corresponding redo.

Replacing the model automatically sets this property to false after the initial layout has completed. The “Modified” DiagramEvent is also raised when an undo or a redo has finished. A “Modified” DiagramEvent listener must not modify this Diagram or its Model.

Whenever you make changes to the model, you must do so within a transaction. Did you do so?

However, I think you can set the Diagram.isModified property at any time, since it isn’t really part of the model or diagram state – it’s more of a “meta-property”.