zzzcpu 发表于 2006-10-2 19:49:44

[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)
)

haibinpro 发表于 2006-10-2 21:20:09

这个不错,谢谢分享。

shoran2 发表于 2023-4-21 16:26:28

大师 请向你致敬

ilovem 发表于 2023-4-23 13:41:49

谢谢楼主无私分享

ilovem 发表于 2023-5-6 10:35:49

加载出错,参数类型不对

happyending 发表于 2025-11-19 08:00:02

学到了有用的知识。感谢分享。
页: [1]
查看完整版本: [LISP程序]:快速改变圆直径的LISP源码