bzhjl 发表于 2013-12-17 14:03
给力!有些确实不能直接闭合,要拉到某个端点来闭合。用这个圈起来就可以人工操作了
- (defun c:tt()
- (if (setq ssa (ssget '((0 . "LINE")))) (progn
- (setq ptb nil i -1)
- (repeat (sslength ssa)
- (setq dxf (entget (ssname ssa (setq i (1+ i))))
- ptb (cons (cdr (assoc 11 dxf)) (cons (cdr (assoc 10 dxf)) 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))
- )
- )
- (setq oldcol (getvar "CECOLOR"))
- (command "COLOR" 1)
- (mapcar '(lambda(x) (command "_circle" x 50)) jgb)
- (command "COLOR" oldcol)
- (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)
- )
|