soly2006 发表于 2012-5-2 13:16
再自顶,顶不出来不罢休
- (defun c:tt (/ MKCIRCLE SS L PL FLAG S i)
- (defun mkcircle (pt r)
- (entmake (list '(0 . "circle")
- (cons 10 pt)
- (cons 40 r)
- (cons 62 1)
- (cons 8 "检查标记")))
- )
- (setq n 0 nn 0)
- (while (progn
- (princ "\n选择要检查的物体:")
- (setq ss (ssget '((0 . "lwpolyline"))))
- )
- (setq s nil n 0)
- (repeat (setq i (sslength ss))
- (setq s (cons (ssname ss (setq i (1- i))) s))
- )
- (foreach en s
- (setq l (vl-remove en s))
- (setq pl (mapcar 'cdr
- (vl-remove-if-not
- '(lambda (x) (= 10 (car x)))
- (entget en))))
- (foreach pt pl
- (setq Flag
- (vl-some
- '(lambda (x)
- (equal (vlax-curve-getclosestpointto en pt)
- (vlax-curve-getclosestpointto x pt)
- 1e-6))
- l))
- (if (not Flag)
- (progn
- (mkcircle pt 1)
- (setq n (1+ n))
- )
- )
- )
- )
- (princ (strcat "\n发现 " (itoa n) "处问题:"))
- (setq nn (+ n nn))
- )
- (princ (strcat "\n总共发现 " (itoa nn) "处问题:"))
- (princ)
- )
|