;;不闭合多段线检查并标记,且使能闭合的图元闭合
(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)
)
;;不闭合多段线检查并标记
(defun c:tt (/ ent i pt1 pt2 r ss)
(setvar "CMDECHO" 0)
(if (setq ss (ssget '((0 . "LWPOLYLINE") (70 . 0))))
(progn
(setq i 0)
(repeat (sslength ss)
(setq ent (entget(ssname ss i))
pt1 (cdr(assoc 10 ent))
pt2 (cdr(assoc 10 (reverse ent)))
r (* (getvar "DIMSCALE") 2)
)
(command ".CIRCLE" "non" pt1 "non" r ".CIRCLE" "non" pt2 "non" r)
(setq i (1+ i))
)
)
)
(setvar "CMDECHO" 1)
(princ)
)