Hi, can you tell me how should I do this in order to disable zoom in undo recording?
The disableUndoRecording() does exactly that, it disables ALL undo recording even Zoom and pan.
So there's no answer for the topic question:
"Is posible to disable undo for CERTAIN operations?"
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.
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.
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 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.
A 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.