By Adam Nagy
I've been using (princ "\r") to update the command line inside my LISP command, but in AutoCAD 2011 it does not seem to work anymore.
You can use the following code to reproduce the issue:
(defun pause(mili / time)
(setq time (getvar "date"))
(while (< (* (- (getvar "date") time) 100000000) mili))
nil
)
(defun c:printtest ()
(princ "\n")
(setq num 1)
(repeat 100
(pause 100)
(setq num (1+ num))
(princ "\r")
(princ num)
)
)
As you can see in AutoCAD 2011 only the last number (101) appears in the command line once the command finished, but nothing in between. This used to work fine before.
Solution
The workaround is to use an additional (princ):
(defun pause(mili / time)
(setq time (getvar "date"))
(while (< (* (- (getvar "date") time) 100000000) mili))
nil
)
(defun c:printtest ()
(princ "\n")
(setq num 1)
(repeat 100
(pause 100)
(setq num (1+ num))
(princ "\r")
(princ num)
(princ) ; with the addition of this the command line gets updated
)
)