Lisp to Ignore Pan and Zoom When Undoing
Good morning,
I am thinking about a lisp routine that will allow you to ignore the zoom and pan commands when running the undo command. Initially what I am thinking as a starting point should work in theory, but it will require extensive use of reactors.
The program starts by undefining the default undo command and then defining reactors for every other command out there (this is the time consuming part), but maybe there is a reactor that can be developed that notices entity changes in the drawing database. The idea is when you draw a line, BricsCAD writes that data to its internal database, this lisp routine then adds the newly created line's data to an undo file. When you run the new undo program, the lisp steps through the undo file backwards and undoes the operations, for the case of the line we just remove that specific entity from the database. in the case of a modification to an entity we would have to store the entity's data before the change in the undo file so that we can just write the old entity data back to the entity in the drawing database.
I might be way out there with this idea but there has to be a way to avoid the zoom and pan operations when undoing.
What are your thoughts?
0
Comments
-
I don't really have a good cohesive idea, but here are some thoughts.One approach might be to record the current view, and then after the undo operations, to restore that view. That may work for one undo, but, I imagine that you want to be able to do multiple undos and not have the view change at each step.If the undo-back sequence is used, then it might be possible to use a undo-mark operation to cause the drawing to do a save-as to a specific temporary file. Then, if you want to undo to the mark, the routine records the current view, opens that temporary file, changes the view to the recorded one, and then does a save-as to the original file name.-Joe0
-
I agree. In AutoCAD, this can be accomplished with the variable UNDOCTL, but not implemented in BCad (v14).
Should be on the wishlist.0 -
I agree. In AutoCAD, this can be accomplished with the variable UNDOCTL, but not implemented in BCad (v14).
Should be on the wishlist.
I don't have an AutoCAD license but I believe you have misunderstood.
The two bits of UNDOCTL that are not implemented in BricsCAD are:
16 = zoom+pan grouped as single action.
32 = layer property operations grouped as single action.
So in AutoCAD also zoom+pan are always part of the undo/redo sequence.
See here.0 -
Zoom & pan grouped works just fine in Acad - takes minimal time/steps but still keeps the monotor showing the relevant bit of the model, which was modified at each step. If undo only undoes modifications, then you won't see it happening on screen because you'll still be zoom/panned to somewhere else.0
This discussion has been closed.