ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Undo marker - return to certain marker

3 REPLIES 3
Reply
Message 1 of 4
damir_vidakovic
768 Views, 3 Replies

Undo marker - return to certain marker

I'm implementing 'history' feature in my Objectarx application, like there is one in Photoshop, or some other applications.  I have a dialog which is filled with actions when a certain command is finished. I keep track only on actions that my application performs, and they are all grouped in undo transaction, so 1 undo will return everything that my command does in AutoCAD. 

 

My undo is working ok, but I'm wondering if I can  make i possible to return several steps at once, or to return to certain step in undo history. 

 

My undoable command code looks like this:

 

pUndo = acdbHostApplicationServices()->workingDatabase()->undoController();
pUndo->beginGroup();
acdbHostApplicationServices()->workingTransactionManager()->startTransaction();

//...code that draws all kinds of stuff 

acdbHostApplicationServices()->workingTransactionManager()->endTransaction();
pUndo->endGroup();

 

 

And then I insert in my history dialog new entry, by some name. 

 

When undo is invoked in AutoCAD, whole thing goes back in one step, and it is nice, but I'd like to go to some 'named marker' back, if it is possible, to have possibility to go  back 'n' steps , not using the loop.

 

---------------------
Damir Vidakovic
www.studioars.com
3 REPLIES 3
Message 2 of 4

Hi Damir,

 

There is not much API to directly work with the undo stack.

But from what you mention, the "Mark" and "Back" options in AutoCAD's undo command should be of some help.

 

You can set a mark and assign a name to it in your application, although AutoCAD does not know about the name.

When undoing based on the name, your application will know how many marks to undo.

 

Regards,

Balaji 



Balaji
Developer Technical Services
Autodesk Developer Network

Message 3 of 4

Thank you for your reply.

 

That is what I have right now, I must call undo 'n' number of times, depending of how many marks I want to go back. There is no possibility of going back  17 marks in one shot, if I understand correctly?

---------------------
Damir Vidakovic
www.studioars.com
Message 4 of 4

I see your point.

 

Sorry, that isn't possible, the back option can only go back from one mark to the other.

 

Regards,

Balaji

 

 

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost