Undo Command, when click on form

I have create a plugin for rhino, but i have a problem with undo the command. when i click button on my form the command commit but i can’t undo command, please help me

I think people are going to need a bit more information than that…

this is my form
when i click make 2D plane, I will create a line, but when I type ctrl Z the line still there and hasn’t been deleted, now i want the line will delete when i type ctrl z

You’re going to have to post more information, preferably some actual code? How are we supposed to even tell how you’re trying to do this?

Hi @toanrhino90,

To modify the document outside of a command and have those modifications undo-able, use this pattern:

var undoRecordSerialNumber = doc.BeginUndoRecord("My document changes"));

// TODO: modify the document here

if (undoRecordSerialNumber > 0)

Does this help?

– Dale

1 Like

thank you very much