undo a command (scripting)

 From:  pressure (PEER)
10939.14 In reply to 10939.13 
Thanks Michael for the edited code!

What you posted works for me by itself, but when I try incorporating it into the larger thing I'm working on I still have the same kind of problem with undo.

I removed the other instances of moi.geometryDatabase.addObjects() and don't have any object pickers, but the problem persists.

Is there a general principal I can use to troubleshoot this?

- Peer