[LISP程序]:快速改变圆直径的LISP源码
本程序先选择同直径圆的一个样例,然后选择区域,则该区域的所有同直径圆被亮选,最后输入要求的直径即可
(defun c:chc (/ sel exap typ1 dia1 cn1 chd gop rad1 num1)
(setq sel (CAR (ENTSEL "\nSelect the example circle: ")))
(print sel)
(SETQ exap (ENTGET sel))
(setq typ1 (cdr (assoc '0 exap)))
(if (= typ1 "CIRCLE")
(progn
(setq rad1 (cdr (assoc '40 exap)))
(setq
gop
(SSGET (list (cons 0 "Circle") (cons -4 "=") (cons 40 rad1))
)
)
(SSSETFIRST NIL GOP)
(princ "\nThe GOP number: ")
(princ (sslength gop))
(setq dia1 (/ (getreal "\nEnter the diameter: ") 2))
(SETQ num1 (- (sslength gop) 1))
(repeat (1+ num1)
(setq cn1 (ssname gop num1))
(SETQ chd (ENTGET cn1))
(setq chd (subst (cons 40 dia1) (assoc '40 chd) chd))
(entmod chd)
(setq num1 (1- num1))
)
)
)
(princ)
) 这个不错,谢谢分享。 大师 请向你致敬 谢谢楼主无私分享 加载出错,参数类型不对 学到了有用的知识。感谢分享。
页:
[1]