<soapbox>
Just what is this insistence on using Undo Marks?
Let's give this a bit of perspective. I, the user, am planning on trying out a few things on my drawing. So I set an Undo Mark, confident that I can get back to this current state by using Undo Back. Now I, the poor unwitting user, uses Bob Billy's routines that set Undo Marks each time I run his code. After using his routine for 100 times, and deciding to return my drawing back to the original state, blissfully use an Undo Back. <huh?> Another Undo Back. <what?> Another Undo Back <curses> Another Undo Back...
Now consider the wise programmer Billy Bob using Undo Begin/End instead, in the same scenario. After hundreds of time using the routine, I issue an Undo Back to return to the original state. <yeah!> I'm back where I started!
<Sample log>
Command: CIRCLE
Specify center point for circle or [3P/2P/Ttr (tan tan radius)]:
Specify radius of circle or [Diameter] <2.2785>:
Command: CMDECHO
Enter new value for CMDECHO <1>: 0
Command: UNDO
Enter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back] <1>: m
Command: (defun C:L (command "._undo" "_m") (command ".line" pause pause "") (princ))
C:L
Command: L
Command: L
Command: L
Command: L
Command: L
Command: UNDO
Enter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back] <1>: b (Lisp Expression) GROUP Mark encountered
Command: UNDO
Enter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back] <1>: b (Lisp Expression) GROUP Mark encountered
Command: UNDO
Enter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back] <1>: b (Lisp Expression) GROUP Mark encountered
Command: UNDO
Enter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back] <1>: b (Lisp Expression) GROUP Mark encountered
Command: UNDO
Enter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back] <1>: b (Lisp Expression) GROUP Mark encountered
;;; Wow, I'm *finally* done. <blech>
Command: UNDO
Enter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back] <1>: m
Command: (defun C:L (command "._undo" "_be") (command ".line" pause pause "") (command "._undo" "_e") (princ))
C:L
Command: L
Command: L
Command: L
Command: L
Command: L
Command: UNDO
Enter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back] <1>: b GROUP GROUP GROUP GROUP GROUP Mark encountered
;;; Wow, *that* was quick
</Sample log>
Naturally, error handling will need to be more involved, but I covered that in a thread within the last two days.
</soapbox>
--
R. Robert Bell, MCSE
www.AcadX.com
| Before you start placing dtext add this:
| (command "undo" "mark")
|
| In your error trap code as this:
| (command "undo" "back")
|
| --
|
| Chip Harper
| Member of the AutoDesk Discussion Forum Moderator Program | | |