马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
问题:
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.
解答:
This behaviour has been logged. The workround 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
- )
- )
|