重复多段线 重复表判别 73哥函数
- (defun plinexy(e / p a b n ob q et d d1 en et)
- (setq a(entget e)ob(vlax-ename->vla-object e)et(cdr(assoc 0 a))n 0 p nil d nil)
- (cond((="LWPOLYLINE"et)
- (repeat(length a)(setq b (nth n a) n (+ n 1))
- (if (= 10 (car b))(progn
- (setq q(list (cadr b) (caddr b))d1(vlax-curve-getDistAtPoint ob q))
- (if p (if (not(member d1 d)) (setq p (append p (list q))d (append d (list d1))))
- (setq p (list q)))))))
- ((="POLYLINE"et)
- (SETQ EN (ENTGET (SETQ E (ENTNEXT E))))
- (WHILE (/= (CDR (ASSOC 0 EN)) "SEQEND")
- (SETQ q (CDR (ASSOC 10 EN))d1(vlax-curve-getDistAtPoint ob q)q(reverse(cdr(reverse q))))
- (if p(if (not(member d1 d)) (setq p (append p (list q))d (append d (list d1))))(setq p(list q)))
- (SETQ EN (ENTGET (SETQ E (ENTNEXT E)))))
- (setq p(reverse p))))P)
- (defun lst-(l1 l2 fuz / a l)
- (while l1
- (setq a(car l1)l1(cdr l1))
- (or(vl-some(function(lambda(x)(equal a x fuz)))l2)
- (setq l(cons a l))))
- (reverse l))
- (defun lst-1 (l1 l2 fuz / l)
- (if l2
- (progn
- (vl-every(function(lambda(a)
- (or(vl-some(function(lambda(x)(equal a x fuz)))l2)
- (setq l(cons a l)))))l1)
- (reverse l))
- l1))
-
- (setq p1(lst- (plinexy (car(entsel "\n请选择一条线:"))) (plinexy (car(entsel "\n请选择另一条线:"))) 0.0001 ))
|