Database.beginCommandBatch


beginCommandBatch(label, [isUndoable])

Scriptable dialogs should use this call, together with closeCommandBatch(), to group together all commands generated by a single user click, for example the OK or Apply buttons. The effect of these commands is to batch the commands together for undo/redo purposes, to show a wait (hourglass) cursor and also to temporarily disable the tree views during processing.

Modeller will automatically capture any definition commands between the call to begin and the call to end, and automatically reproduce them in the session file and undo mechanism. Note however that cosmetic commands such as rotations, selections, and colour changes, will not be captured. If this is necessary, you must use createUndoableEvent() to specify exactly which commands should be used

labelstringlabel to be used for undo and redo buttons
isUndoableoptional string "undoable", "not undoable", "ignored for undo", or "not redoable"
Return valuenone 

Example

To indicate that two loads were created by the same mouse click


 db.beginCommandBatch("create two loads")
 db.createLoadingConcentrated("my load 1", ...)
 db.createLoadingConcentrated("my load 2", ...)
 db.closeCommandBatch()
subsequently pressing 'undo' once will delete both loads. subsequently pressing 'redo' once will re-create both loads.

Back to Database

Back to Overview