xyp1964 发表于 2023-12-5 12:45:48


(defun c:tt ()
(defun SubUpd(e dxf val)
    (entmod (subst (cons dxf val)(assoc dxf (entget e))(entget e)))
    (entupd e)
)
(if (and (setq rr (getreal "\n输入新半径: "))
         (setq p1 (getpoint "\n选择基点: "))
         (setq p2 (getcorner p1 "\n对角点: "))
         (setq ss (ssget "C" p1 p2 '((0 . "circle"))))         
         (setq i -1)
      )
    (while (setq s1 (ssname ss (setq i (1+ i))))(SubUpd s1 40 rr))
)
(princ)
)

bonny 发表于 2023-12-5 16:06:57

(defun c:tt (/ r)
        (if (and (setq r (getdist "\n输入或量取新半径:"))
                                (ssget '((0 . "CIRCLE")))                               
                        )
                (vlax-for e (vla-get-activeselectionset (vla-get-ActiveDocument (vlax-get-acad-object)))
                        (vla-put-Radius e r)
                )
        )
)

bonny 发表于 2023-12-5 16:18:30

hhh454 发表于 2023-11-3 23:29
批量更新圆的半径
http://bbs.mjtd.com/forum.php?mod=viewthread&tid=188850&fromuid=363233
(出处: 明 ...

打只苍蝇,不需要研发量子炮吧:lol

xyp1964 发表于 2023-12-5 23:19:21

(defun c:tt ()"批量更新圆或圆弧的半径"
(setq r (Ureal 7 "" "新半径" r))
(while(setq s(ssget'((0 . "CIRCLE,ARC"))))(xyp-SubUpd s 40 r))
(princ)
)
页: 1 [2]
查看完整版本: 这个代码错哪了啊?检查了很多遍都找不到原因