- (defun c:ccc()
- (if (setq ssa (ssget '((0 . "LINE"))))
- (progn
- (setq ptb nil i -1)
- (repeat (sslength ssa)
- (setq dxf (entget (ssname ssa (setq i (1+ i))))
- p10 (cdr (assoc 10 dxf))
- p11 (cdr (assoc 11 dxf))
- ptb (cons p11 (cons p10 ptb))
- )
- )
- (setq jgb nil fhz nil)
- (while (setq pt (car ptb)
- ptb (cdr ptb)
- )
- (if (member pt ptb)
- (setq ptb (vl-remove pt ptb)
- fhz (cons pt fhz)
- )
- (setq jgb (cons pt jgb))
- )
-
- )
- (mapcar '(lambda(x) (command "_circle" x 50)) jgb)
-
- ;变量tymlb储存刚好首尾相接直线的图元名列表
- (setq tymlb nil)
- (foreach pt fhz
- (setq ssa (ssget "c" pt pt '((0 . "LINE")))
- i -1
- )
- (repeat (sslength ssa)
- (if (not (member (setq ent (ssname ssa (setq i (1+ i)))) tymlb))
- (setq tymlb (cons ent tymlb))
- )
- )
- )
- )
- )
- (princ)
- )
|