More About Reversing Actions

The behavior of the Undo command depends on the action to be reversed.

Global Actions and Local Transitions

You need to understand the difference between a global action and a local transition.

When you run a command or or when you start editing an object, you start a global action. Such action is identified in the Undo/Redo Overview dialog box by a name beginning with "Start" (e.g. "Start Edition : Part xxx, "Start line definition...", etc.). Inside a command, you perform internal transitions and some of them are displayed in the Undo/Redo Overview dialog box with a name ending with "..." to distinguish them from global commands (e.g. "Select search results..."). When a command is over, local actions are committed and replaced in the Undo/Redo Overview dialog box by a global action representing everything you did while running the command.

A global action can sometimes be seen as a local action from a more global point of view: this is the case, for instance, for an exclusive command performed while editing, or for a shared command used while running another command.

You can reverse then recover internal transitions as long as you are in the command. If several reverse actions are successively performed until the command itself is reversed, then you cannot recover the command's internal transitions. When a command is reversed, you cannot use the Redo command to restart it.

For instance, suppose the following scenario with three steps and two different cases:


  • step 1: copy an object.
  • step 2: paste the object.
  • step 3: select the object then move it.

Case 1

Click Undo: this moves the object back to its original position in step 2.

Click Redo: this moves the object to the location defined in step 3.

You can reverse then recover the move because you are still in the Select command.

Case 2

Click Undo: this moves the object back to its original position in step 2.

Click Undo again: the paste action is canceled and you go back to step 1.

Click Redo: the object is pasted. But you cannot recover step 3 after this and if you display the overview, you can see that it is empty. You cannot recover the move because the second reversion impacts the Paste command and not the Select command anymore.

Undo Mechanism

Not all commands can be reversed. And for those that can be reversed, the impact might sometimes be larger than expected.

Reversible actions

Standard reversible actions are:


  • Start action (such as "Start Edition: ..."): can be reversed (but not recovered) in most cases. When reversed, you go back to the default command which is Select in most cases. The Select command is specific: as this is the default command in many cases, no starting action is stored in the Undo stack and therefore, this command cannot be stopped unless you run another exclusive command. However, like other commands, every local action (including shared commands) performed while running the Select command is committed when another exclusive command is run.
  • User interaction in a command: can be reversed and recovered if allowed by the application. If allowed, you go back to the previous dialog step.
  • End of a command: modifications made since the beginning of the command are stored in a global reversible and recoverable action, unless the model has not been modified during the command.
  • Start edition in context: can be reversed (but not recovered). When reversed, you go back to the previous editor.
  • End of edition in context: modifications made since the beginning of the command are stored in a global reversible action.

Some commands are not reversible because they would consume too much memory to enable reversibility. This means that you cannot reverse actions that have been previously performed before these commands.

Using commands such as Open, Close or Propagate empties the Undo stack for integrity reasons. This means that you cannot reverse actions that have been previously performed before these commands.

When you reverse an action, you go back to the editor and the window that were active at the beginning of the action.

The Redo stack is emptied as soon as you perform a new action (except an Undo action, of course). This means that if you reverse an action, then perform this action again using a different method, you will not be able to recover this action because the Undo/Redo mechanism considers that two different actions have been performed even if both actions give the same result.

UI-activation

You can reverse the UI-activation of an object but note that this also cancels any other action performed during the object's activation.

Cancel commands

There are many ways to cancel a command you are running: clicking Cancel in a dialog box, deactivating the icon command, starting a new command, or activating another editor. The result is that any action you may have performed between the command creation and the canceling action is reversed.

For user convenience, some commands keep modifications from the previous editor when activating a second editor, such as the Sectioning command. Below is an example:

  1. When using the Sectioning command in a first editor, activate a second editor: modifications done in the first editor are kept in the second editor.
  2. In the second editor, use the Pad command till its end to create a pad.
  3. Reactivate the first editor window: the Sectioning command is re-activated.
  4. Use the Sectioning command, then click OK:
    • If you click Undo in the first editor, it will reverse only actions performed from the reactivation of the editor to the end of the Sectioning command.
    • If you click Undo again, actions performed in the second editor will be reversed.
    • If you click Undo again, actions performed by the Sectioning command when in the first editor for the first time will be reversed.

About Settings

The Undo command does not let you restore the default settings (after changing them via Tools > Options...).

This can only be done using Reset in the Options dialog box.

For more information, see Installation and Deployment Guide: Common Installation and Administration Tools: Managing Settings: Resetting Default Settings Without Locks.