请大侠们帮忙看一下这段LISP程序哪个地方有错误,我加载后用不了,应该是有错。能不能帮忙改改,有追加的

2024-12-03 00:26:02
推荐回答(1个)
回答(1):

错误太多了,快疯了……
(defun c:cz ()
(setq b (getstring "1屏幕拾取/2键入:"))
(if (= b "1")
(list (setq c (entget (ssname (ssget) 0)))
(setq a (cdr (assoc 1 c)))
(setq a1 (cdr (assoc 8 c)))
(setq a2 (cdr (assoc 62 c)))
(setq ss (ssget "x" (list (cons 1 a) (cons 8 a1))))
)
)
(if (= b "2")
(list (setq a (getstring "要查找的字符串:"))
(setq a1 (getstring "字符串所在图层:"))
(setq ss (ssget "x" (list (cons 1 a) (cons 8 a1))))
)
)
(setq i (sslength ss))
(setq j 0)
(while (< j i)
(setq a (entget (ssname ss j)))
(setq R (* 1 (cdr (assoc 40 a))))
(setq R1 (* 1.1 (cdr (assoc 40 a))))
(setq R2 (* 1.2 (cdr (assoc 40 a))))
(setq pt (mapcar '+ (list (/ r 2) (/ r 2) 0) (cdr (assoc 10 a))))
(command "-color" 1)
(command "circle" pt r)
(command "-color" 2)
(command "circle" pt r1)
(command "-color" 6)
(command "circle" pt r2)
(setq j (+ j 1))
)
(setq b "")
)