undo a command (scripting)

 From:  Michael Gibson
10939.7 In reply to 10939.6 
Hi Peer,

re:
> So would it be correct to say:
>
> At most 1 geometry undo unit is made per command.

Yes, it happens automatically as part of the stuff that's done after a command exits.


> 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

Yes, it's any object that was added or removed from the geometry database while the command was running. Annotations are a subclass of GeomObject.


> objectStyle

When an object style is added that makes a different kind of undo unit, a StyleList undo unit. These ones are created by script calls to

moi.geometryDatabase.styleEditorOpened();
moi.geometryDatabase.styleEditorClosed();

that bracket the showing of the edit style dialog.


> These methods are the only ones that trigger creation of a selection undo unit:
> deselectAll
> invertSelection
> selectAll
> selectLastCreated
> selectNamed
> selectLoop
> selectVisible

No this isn't a complete list. Doing selection using the scene browser or object properties dialog will also generate them and also things that do hide/show/lock/unlock as well like moi.geometryDatabase.hide(), isolate(), showSubset(), lock(), isolateLock(), unlockSubset().

- Michael