本帖最后由 llsheng_73 于 2022-6-17 11:25 编辑
- (defun s2e(s / n lst)(if(=(type s)'pickset)(repeat(setq n(sslength s))(setq n(1- n)lst(cons(ssname s n)lst)))))
- (defun chains(es fuz / e a b s pts)
- (setq s(ssadd))
- (while es
- (setq e(car es)es(cdr es)
- p1(mapcar'+'(0 0)(vlax-curve-getStartPoint e))p2(mapcar'+'(0 0)(vlax-curve-getendPoint e)))
- (foreach a(S2E(ssget"CP"(list p1(list(car p1)(cadr p2))p2(list(car p2)(cadr p1)))'((0 . "arc,*spline,*polyline,line"))))
- (or(SSMEMB a s)
- ((lambda()
- (setq p1(mapcar'+'(0 0)(vlax-curve-getStartPoint a))
- p2(mapcar'+'(0 0)(vlax-curve-getendPoint a)))
- (and(vl-some'(lambda(x)(or(equal p1 x fuz)(equal p2 x fuz)))pt)
- (setq es(cons a es)pt(vl-list* p1 p2 pt))
- (ssadd a s)))))))
- (sssetfirst'nil s))
- (defun c:tt()
- (chains(s2e(ssget'((0 . "arc,*spline,*polyline,line"))))0.1))
|