leasson 发表于 2006-4-6 22:58:00

[LISP]程序死机问题

为什么当我用了(defun sf(list_index)<BR>&nbsp; (setq ll list_index)<BR>&nbsp; (cond((= ll 0)<BR>&nbsp;(command "scale" "w" (list 100 100 0) (list 420 210 0) "" p1 1)<BR>&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((= ll 1)<BR>&nbsp;(command "scale" "w" (list 100 100 0) (list 420 210 0) "" p1 3)<BR>&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((= ll 2)<BR>&nbsp;&nbsp;(command "scale" "w" (list 100 100 0) (list 420 210 0) "" p1 0.5)<BR>&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<BR>&nbsp; )命令以后。第一次运行不会出错。再运行的时候就会死机!!!(其中list_index为数字0。1。2。)绘一个图形。p1为缩放基点。数字为缩放倍数。

njcknfy 发表于 2006-4-10 21:37:00

<P>出现死机时是不是出现以下的错误界面</P>

xyp1964 发表于 2006-4-10 21:52:00

也许这样更好:
(defun sf (mode p1)
(setq ss (ssget "w" (list 100 100 0) (list 420 210 0)))
(cond ((and (= mode 0) ss)
(command "scale" ss "" p1 1)
)
((and (= mode 1) ss)
(command "scale" ss "" p1 3)
)
((and (= mode 2) ss)
(command "scale" ss "" p1 0.5)
)
(t (princ))
)
)

leasson 发表于 2006-4-13 22:24:00

<P>死机时出现的画面好象不是上面那样的。不过后面的程序应该可以的。谢了!!!</P>
页: [1]
查看完整版本: [LISP]程序死机问题