.NET

Reply
Valued Contributor
84 Posts
2 Kudos
Registered: ‎05-12-2009
Post 1 of 9

Undo recording

615 Views, 8 Replies
03-16-2010 03:54 AM
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
Valued Contributor
84 Posts
2 Kudos
Registered: ‎05-12-2009
Post 2 of 9

Re: Undo recording

03-17-2010 12:08 AM 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
Contributor
19 Posts
0 Kudos
Registered: ‎05-14-2013
Post 3 of 9

Re: Undo recording

05-14-2013 02:27 AM in reply to: danny.boy.1

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

ADN Support Specialist
352 Posts
27 Kudos
Registered: ‎07-24-2007
Post 4 of 9

Re: Undo recording

05-28-2013 10:55 AM in reply to: gregorio.grasselli

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





Fenton Webb

Developer Technical Services

Autodesk Developer Network


Contributor
19 Posts
0 Kudos
Registered: ‎05-14-2013
Post 5 of 9

Re: Undo recording

05-28-2013 11:50 PM in reply to: fenton.webb

So there's no answer for the topic question: 

"Is posible to disable undo for CERTAIN operations?"

ADN Support Specialist
761 Posts
100 Kudos
Registered: ‎03-21-2011
Post 6 of 9

Re: Undo recording

05-29-2013 05:30 AM in reply to: gregorio.grasselli

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

Valued Mentor
370 Posts
175 Kudos
Registered: ‎05-06-2012
Post 7 of 9

Re: Undo recording

05-29-2013 05:45 AM in reply to: gregorio.grasselli

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.

 

ADN Support Specialist
352 Posts
27 Kudos
Registered: ‎07-24-2007
Post 8 of 9

Re: Undo recording

05-29-2013 07:47 AM in reply to: DiningPhilosopher

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

Developer Technical Services

Autodesk Developer Network


Valued Mentor
370 Posts
175 Kudos
Registered: ‎05-06-2012
Post 9 of 9

Re: Undo recording

05-30-2013 01:57 PM in reply to: fenton.webb

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.

 

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post