李青松 发表于 2021-3-4 14:02:13

圆弧变圆

选择圆弧-运行程序命令回车-变成圆    用lisp怎样写这个程序

de158168 发表于 2021-3-4 14:02:14

圆弧变圆deby
(defun c:deby()
(princ "\n 右键确定")

(setq ss(ssget '((0 . "ARC" ))))
(setq len(sslength ss))
(setq i -1)
(repeat len
(setq i (1+ i))
(setq en1(ssname ss i))
(setq e1 (entget en1))
(setq o (cdr (assoc 10 e1))
       r (cdr (assoc 40 e1))
       p0 (cdr (assoc 50 e1))
       pn (cdr (assoc 51 e1)))
(command "circle" o r ))
(command "erase" ss "")

(princ)
)

gowww 发表于 2021-4-20 07:14:33

能删除重复圆吗?

zwq8629 发表于 2023-7-1 15:36:55

de158168 发表于 2021-3-4 14:02
圆弧变圆deby
(defun c:deby()
(princ "\n 右键确定")


能不能不要“右键确定”,   就是点圆弧就直接变成圆,不需要再按右键

前生 发表于 2023-7-5 13:56:35

(defun c:deby ()
;;;(princ "\n 右键确定")
(while
(setq ss (ssget '((0 . "ARC"))))
(setq len (sslength ss))
(setq i -1)
(repeat len
    (setq i (1+ i))
    (setq en1 (ssname ss i))
    (setq E1 (entget en1))
;;;    (setq o(cdr (assoc 10 e1))
;;;          r(cdr (assoc 40 e1))
;;;          p0 (cdr (assoc 50 e1))
;;;          pn (cdr (assoc 51 e1))
;;;    )
;;;(command "circle" o r )
    (entmake (list (cons 0 "circle")
                   (assoc 8 e1)
                   (assoc 10 e1)
                   (assoc 40 e1)
             )
    )
    (entdel en1)
)
)
;;;(command "erase" ss "")
(princ)
)
页: [1]
查看完整版本: 圆弧变圆