Drawings SDK Developer Guide > Working with .dwg Files > Working with Entities > Creating a Custom Entity > Implementing Undo and Redo Operations > Restoring Object States
Restoring Object States

Restoring a previous object state is performed by reading the record from the undo filer and applying modification methods of the object for parameters being rolled back. Before restoring the previous object state during an undo operation, recording of the current object state is performed for the assumed redo operation. This is done automatically using the same mechanisms that are used for undo recording.

If the object does not use partial undo, the state of the object is restored automatically. You must take care of restoring the object state only when using partial undo by overriding the implementation of the applyPartialUndo() method.

If the object uses automatic undo, the state of the object is restored by calling its dwgInFields() method.

See Also

Implementing Undo and Redo Operations

Recording Object States

Implementing Partial Undo

Implementing Save and Load Functions

Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.