释放不掉的局部变量!1
小的写了条程序,不知是哪里写错了,死活就是不能把局部变量给释放掉,求助于高手!如以下程序,局部变量( t1 mn i ni ay ax n t2 str k a1 a10 fom)死活去不掉!!
(defun c:qf( / t1 mn i ni ay ax n t2 str k a1 a10 fom)
(setvar "osmode" 0)
(print "<QF编码>功能已开启")
(princ ">>请选择对象...")
(setq nu(ssget (list '(0 . "INSERT") '(8 . "1"))))
(setq t1 1)
(form1)
(setq i 0 n 0)
(repeat (sslength nu)
(setq mn(nth n fom))
(setq i 0)
(repeat (sslength nu)
(setq ni(entget(ssname nu i)))
(setq ax(cadr(assoc 10 ni)))
(setq ay(- (caddr(assoc 10 ni)) 12.69))
(if (= mn ax)
(progn (setq ax(+ 4.61 (cadr(assoc 10 ni)))) (xt))
)
(setq i(1+ i))
)
(setq n(1+ n))
)
(setvar "osmode" 15359)
(princ)
)
(defun xt()
(setq t1(rtos t1))
(setq t2(strcat t1 "QF"))
(setq text(list (cons 0 "TEXT") (cons 102 "{ACAD_REACTORS") (list 10 ax ay 0.0) (cons 40 3) (cons 1 t2) (cons 8 "2")))
(entmake text)
(setq t1(atof t1))
(setq t1(+ t1 1))
(princ)
)
(defun form1()
(setq str nil k 0)
(repeat (sslength nu)
(if (ssname nu k);判断是否存在下一个图素
(progn (setq a1(entget(ssname nu k)))
(setq a10(cadr(assoc 10 a1)))
(setq str(append str (list a10)))
)
)
(setq k(1+ k))
)
(setq fom(vl-sort str '<))
(princ)
)
试过了,没有出现不能释放的情况,是不是执行中出错了啊? 猜是 命令列 所设定的变量值
Command: (defun C:test (/ a b) (setq a 1 b 2) (+ a b))
C:TEST
Command: test
3
Command:
Command: !a
nil
Command: (setq a 5)
5
Command: test
3
Command:
Command: !a
5 我同样遇到这样的问题,请问该怎么解决哈
页:
[1]