Learning MicroStation VBA

The last interface exposing MicroStation events that we will look at in this book is the "Change Track Events" interface which exposes four events: BeginUndoRedo, ElementChanged, FinishUndoRedo, and Mark. We will look at two of those.
Private Sub IChangeTrackEvents_BeginUndoRedo( _ ByVal AfterUndoRedo As Element, _ ByVal BeforeUndoRedo As Element, _ ByVal Action As MsdChangeTrackAction, _ ByVal IsUndo As Boolean) End Sub<a name="968"></a><a name="beginpage.56B195A0-1C65-4AEF-B006-4FD8D0C36A12"></a><a name="969"></a><a name="beginpage.522113CE-5780-44AC-B955-05BAB492F3C2"></a>
The BeginUndoRedo event is triggered before any undo or redo. 'AfterUndoRedo' points to the element with all of its properties after the Undo or Redo action. The 'BeforeUndoRedo' parameter points to the element with all of its properties before those actions. The 'Action' parameter tells which type of action has taken place. 'IsUndo' helps us know whether the action was an Undo or a Redo. Let's look at some code in this event:
Private Sub IChangeTrackEvents_BeginUndoRedo( _ ByVal AfterUndoRedo As Element, _ ByVal BeforeUndoRedo As Element, _ ByVal Action As MsdChangeTrackAction, _ ByVal IsUndo As Boolean) Debug.Print AfterUndoRedo.Level.Name & vbTab & _ BeforeUndoRedo.Level.Name & vbTab & _ Action & vbTab & IsUndo End Sub<a name="970"></a><a name="beginpage.208A3E12-CACC-4831-8B25-C6FC6C853188"></a>
In this example we write the Level Names of the...