Modeller.createUndoableEvent


createUndoableEvent(command, undoCommand, description)

To be used by user dialogs to create named events which are repeatably undo-able and redo-able. E.g. a dialog might create two discrete loads to represent a pedestrian. The dialog would probably issue two commands of the form "db.createLoadingDiscretePoint(...)". Calling these commands directly from VBS will create the loads, the two loading definitions will appear in the session file, and the two events will be seperately undoable, however there will be nothing to tie these events to the pedestrian load dialog. Additionally the session file created will be an automatically generated one, and although it will contain the same information, it will not be precisely what was entered. It would also probably be desireable to have undo remove both loads, rather than one at a time. If instead, the dialog calls


 createUndoableEvent("db.createLoadingConcentrated(...):db.createLoadingConcentrated(...),
                     "db.deleteAttribute(...):db.deleteAttribute(...)",
                     "Create Pedestrian Load")
 
this gives LUSAS Modeller all the information necessary to create an undo-able event. Not only will it create the loads, but the creations will appear in the session file using precisely the given commands, and using the label "Create Pedestrian Load". The events will be undo-able and redo-able together, again, using the label "Create Pedestrian Load"

Note that this system is similar to that described in beginCommandBatch. The advantage of beginCommandBatch is that the necessary commands are captured automatically by Modeller. The advantage of createUndoableEvent is that cosmetic events such as rotations, selections, and colour changes can also be specified.

commandstringSnippet of VBScript to execute to do and redo the event
undoCommandstringSnippet of VBScript to execute to undo the event
descriptionstringtext to appear in undo and redo button descriptions
Return valuenone 

See also beginCommandBatch closeCommandBatch

Back to Modeller

Back to Overview