Hi Michael,
So would it be correct to say:
- At most 1 geometry undo unit is made per command.
- A geometry undo unit is only made if a command causes one of the following to either be added to or deleted from the database:
- annotationObject
- geomObject
- objectStyle
- These methods are the only ones that trigger creation of a selection undo unit:
- deselectAll
- invertSelection
- selectAll
- selectLastCreated
- selectNamed
- selectLoop
- selectVisible
Maybe this explains some other stuff I've been wondering about. It seems like no undo units are made if either of the following commands is run:
code:
DoCannotUndo();
function DoCannotUndo() {
var topObjectsList = moi.geometryDatabase.getObjects();
var topObj = topObjectsList.item(0);
var subObjList = topObj.getSubObjects();
for ( var i = 0; i < subObjList.length; ++i ) {
var subObj = subObjList.item(i);
if ( subObj.isSeamEdgeCurve === true ) {
subObj.hidden = true;
}
}
}
code:
var selObjList = moi.geometryDatabase.getSelectedObjects();
var annotationObjectList = selObjList.getAnnotations();
for (var i = 0; i < annotationObjectList.length; ++i) {
var annotation = annotationObjectList.item(i);
annotation.arrowheadType = 'dot';
}
Is that because they don’t add/delete an annotationObject, geomObject, or objectStyle and also don't contain any of the selection methods above? Is there a way that I can make this sort of command undoable?
Something that confuses me about DoCannotUndo is that if a command that does some other stuff that causes an undo unit to be made also contains DoCannotUndo, then undoing will undo that other stuff, but won't make the seams hidden by DoCannotUndo visible again.
Here's an example: http://moi3d.com/forum/index.php?webtag=MOI&msg=10937.1
|