AcTransactionManager::endTransaction(); // AKA "UNDO END"
AcTransactionManager::abortTransaction(); // AKA "UNDO END U"
Typically, you don't use these for incremental UNDO, since
you would want to allow the entire command to be UNDO-able
as a single operation, once it's complete.
I typically implement my own incremental or local undo by
just keeping a list or array of objects created, and then
just erase the last element in response to a request to
UNDO the last item created. That also allows full redo
capability as well, which would not be possible using the
transaction manager.
"bpete" <balin...@fluid-desk.pl> wrote in message news:f1158...@WebX.maYIadrTaRb...
> I need to set boundaries for the undo command _within_ one of my ARX defined commands (think of the standard LINE
command - I have a similar command for custom objects and want undo to remove segments one at a time).
>
> There is no way (that I have found) to do this from ARX - I tried document locking / unlocking (with both kWrite and
kAutoWrite), which is supposed to set undo markers, to no avail. The ObjectARX documentation has some references to an
AcDbUndoController object, which probably has something to do with this mechanism :), but it's only declared - it is not
actually defined anywhere in the ARX headers!
>
> The only method that works so far is the EndUndoMark and BeginUndoMark function of the IAcadDocument ActiveX
interface, but I would not like to use this for various reasons (it causes serious problems in LT).
>
> I would appreciate any ideas on how to resolve this issue - I can't believe that this functionality available to
ActiveX is not implemented anywhere in ObjectARX.
>
> Bálint Pete
>
Sorry, but you drew an analogy to the LINE command:
> (think of the standard LINE command - I have a
> similar command for custom objects and want undo
> to remove segments one at a time).
The line command does not allow you to undo
individual segments after the command has ended,
and I assumed that's what you wanted.
While there's probably a way to do what you want,
I can't really tell you how, since I've never done
that, mainly out of preference for the fact that it
would be inconsistent with the behavior of built-in
commands.