Undo Transactions step-by-step within a CommandMethod

Undo Transactions step-by-step within a CommandMethod

SRSDS
Advisor Advisor
914 Views
3 Replies
Message 1 of 4

Undo Transactions step-by-step within a CommandMethod

SRSDS
Advisor
Advisor

Hi,

 

I have a CommandMethod which has a loop that opens and commits transactions until the user is finished with it and exits. 

 

I would like each transaction to be undone seperately but the undo command undoes the CommandMethod (along with all the transactions that occured while in the loop)

 

Do I need to use the COM StartUndoMark and EndUndoMark to get this working?

 

Hope someone can help,

 

 

0 Likes
915 Views
3 Replies
Replies (3)
Message 2 of 4

hgasty1001
Advisor
Advisor

Hi, 

 

TT implemented a clever way to allow undos in this link: Undo

 

Gaston Nunez

0 Likes
Message 3 of 4

SRSDS
Advisor
Advisor

Dim curdoc As IAcadDocument  is not recognised.

 

Appologies for my ignorance.but is this a COM component that I need to reference in?

 

0 Likes
Message 4 of 4

hgasty1001
Advisor
Advisor

Hi,

 

Yes, IAcadDocument can be replaced by Autodesk.AutoCAD.Interop.AcadDocument, you need to set references to  Autodesk.AutoCAD.Interop and Autodesk.AutoCAD.Interop.Common you can find the references in the GAC or the inc folder of the SDK depending on version.

 

Gaston Nunez

0 Likes