不闭合多段线检查并标记,且使能闭合的图元闭合
本帖最后由 fangmin723 于 2020-11-25 09:10 编辑;;不闭合多段线检查并标记,且使能闭合的图元闭合
(defun c:PC(/ ent gss i pt1 pt2 r ss)
(setvar "CMDECHO" 0)
(command "UNDO" "be")
(if (setq ss (ssget '((0 . "LWPOLYLINE") (70 . 0))))
(progn
(setq i 0 gss (ssadd))
(repeat (sslength ss)
(setq
ent (entget (ssname ss i))
pt1 (cdr(assoc 10 ent))
pt2 (cdr(assoc 10 (reverse ent)))
r (* (getvar "DIMSCALE") 2)
)
(ssadd (entmakex (list '(0 . "circle") (cons 10 pt1) (cons 40 r) (cons 62 2)))gss)
(ssadd (entmakex (list '(0 . "circle") (cons 10 pt2) (cons 40 r) (cons 62 2)))gss)
(if (equal pt1 pt2 1E-8) (entmod (subst '(70 . 1) (assoc 70 ent) ent)))
(setq i (1+ i))
)
(command "-group" "" "*" "" gss "")
)
)
(command "UNDO" "e")
(setvar "CMDECHO" 1)
(princ)
)
好东西哈,顶一下无私奉献 谢谢分享,理解undo “be” 和undo “e“的功能 谢谢分享。。。。。 好东西,非常需要,感谢无私奉献 好东西!非常感谢! 好东西,正好需要 好东西哈,顶一下无私奉献
页:
[1]