我按书本上的程序输入如下,加载后,运行程序(C:Tex),提示“缺少参数”;
而后我又试用CAD自带的原程序,也有类似;在2002及2004一样。
(defun c:Tex (/pnt1 a b c d e f) (graphscr) (setq pntl (getpoint "\nStarting point:")) (setq a (getdist pnt1 "\nEnter Height:")) (setq b (getreal "\nNumber of text lines:")) (setq c (getdist pnt1 "\nLine Spacing:")) (setq d "T") (while d (setq e(getstring 1 "\nEnter Text:")) (setq b (-b 1)) (if (=b 0)(setq d nil)) (command "Text" pntl a "0" e) (setq pntl (list (car pntl) (-(cadr pntl) c))) ) )
你自己对一下,总共错了几处
(defun c:Tex ( / pnt1 a b c d e f);_这里错了一处 (graphscr) (setq pntl (getpoint "\nStarting point:")) (setq a (getdist pntl "\nEnter Height:"));_这里错了一处 (setq b (getreal "\nNumber of text lines:")) (setq c (getdist pntl "\nLine Spacing:"));_这里错了一处 (setq d T);_这里错了一处 (while d (setq e (getstring 1 "\nEnter Text:")) (setq b (- b 1)) ;_这里错了一处 (if (= b 0) (setq d nil) ) (command "Text" pntl a 0 e) (setq pntl (list (car pntl) (- (cadr pntl) c))) ) )
(defun c:Tex (/ pnt1 a b c d e f);"/"后应有空格 (graphscr) (setq pnt1 (getpoint "\nStarting point:")) ;关键的地方在这里,你把pnt1输成了pntl
(setq a (getdist pnt1 "\nEnter Height:")) (setq b (getreal "\nNumber of text lines:")) (setq c (getdist pnt1 "\nLine Spacing:")) (setq d T) ;;T (while d (setq e(getstring 1 "\nEnter Text:")) (setq b (- b 1)) ;"-"号后成要有空格
(if (= b 0)(setq d nil)) (command "Text" pntl a "0" e) (setq pntl (list (car pntl) (-(cadr pntl) c))) ) )
再试试