Undo/Redo behaviour similar to transactions
I am currently facing the problem that I want to undo operations in a way that is similar to transactions. E.g. saving a point in time and then doing operations via COM/.Net and potentially undoing all operations until the saved point in time.
I thought of 3 possible solutions:
Using Built-In transactions from BricsCAD ("AcadDocument.AbortTransaction"). The problem is that only after the transaction is completed the display gets updated, e.g. newly placed objects are not drawn.
Manually programming an Undo/Redo-stack. This however fails when I want to undo delete operations, as I was not able to re-add an object once it was deleted. Adding the object again will yield a different handle which will have side effects down the line.
Using the Undo/Redo Operations of BricksCAD. However those will track all changes made to the document and not only the changes I perform via code.
Do you have any suggestions how to implement my problem?
Thanks!
Eike Stein
Comments
-
I solved this by using "document.SendCommand("_UNDO\n_M\n");" and "document.SendCommand("_UNDO\n_B\n");"
See https://www.bricsys.com/bricscad/help/en_US/CurVer/DevRef/index.html for more detail0