undo a command (scripting)

 From:  pressure (PEER)
10939.9 In reply to 10939.7 
Hi Michael,

I've been digesting your last couple of messages while trying to figure out how to force a command that doesn't create/destroy geometry to get an undo unit.

I figured out that using moi.ui.propertiesPanel.setAnnotationProp() is a way to do this for my annotation example.

But, I'm still not sure how to get an undo unit when changing object visibility, lock state, or selection state. One hack for getting an undo unit associated with setting hidden=true is:
code:
    moi.geometryDatabase.deselectAll();
    seamEdgesList.setProperty('selected', true);
    moi.geometryDatabase.hide();

But, that doesn't seem quite right. I'm wondering about what gets run when I click on a lock or visibility icon or in the selection dot column in the browser. What happens when I click on the Visible.png icon in the browser?

What gets called when I do selection using the scene browser or object properties dialog?

- Peer