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

Undo recording

8 REPLIES 8
Reply
Message 1 of 9
danny.boy.1
1616 Views, 8 Replies

Undo recording

Hello

Is posible to disable undo for certain operations?

I want to disable undo for some for some transactions...
if posible it...

Thanks in advance.

Best regards,
Danijel Ivankovic
8 REPLIES 8
Message 2 of 9
danny.boy.1
in reply to: danny.boy.1

I founded solution.



Dim db As Database = HostApplicationServices.WorkingDatabase
db.DisableUndoRecording(True)

'All what you do here, autocad will not recording for undo...

db.DisableUndoRecording(False)

Best regards,
Danijel Ivankovic
Message 3 of 9

Hi, can you tell me how should I do this in order to disable zoom in undo recording?

Message 4 of 9

The disableUndoRecording() does exactly that, it disables ALL undo recording even Zoom and pan.




Fenton Webb
AutoCAD Engineering
Autodesk

Message 5 of 9

So there's no answer for the topic question: 

"Is posible to disable undo for CERTAIN operations?"

Message 6 of 9

Sorry, the API does not provide such control over the Undo recording.

 

I tried redefining the command to prevent the undo recording but this did not work for Zoom while it did work for the Line command.

 

Sorry, I dont find any way to achieve this and I remember we have a wish list with our engineering team to provide this functionality.

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Message 7 of 9

As Fenton implied, disableUndoRecording() is an all-or-nothing proposition.

 

You generally can't be selective about undo/redo because of the interdepenence that can exist between objects, and the fact that any given object's state can be dependent on the existence and/or state of one or more other objects. Not undoing everything can easily result in a corrupt object that can (for example) reference another object that no longer exists.

 

You can kliudge it of course, using something like ObjectOverrules, or various other notifications.

 

Message 8 of 9

So, now I'm getting the context more clearly - It is possible to turn UNDO recording off and on at your will, for instance, you can turn off UNDO recording in a CommandWillStart() == 'ZOOM' and then turn it back on in CommandEnded.

 

The function literally bypasses writing undo details to the undo filer, so you can even turn it off mid command if you really wanted to, but I don't recommend that.




Fenton Webb
AutoCAD Engineering
Autodesk

Message 9 of 9


@fenton.webb wrote:

So, now I'm getting the context more clearly - It is possible to turn UNDO recording off and on at your will, for instance, you can turn off UNDO recording in a CommandWillStart() == 'ZOOM' and then turn it back on in CommandEnded.

 

The function literally bypasses writing undo details to the undo filer, so you can even turn it off mid command if you really wanted to, but I don't recommend that.


quick test suggests this doesn't work.

 

I would also think the 'context' would include transparent zooms and pans. I'd be interested in seeing a solution that accommodates that aspect.

 

 

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost