(defun CheckSamePoint (p / p0 i exit0)
(setq i -1)
(while (and intps
(setq p0 (nth (setq i (1+ i)) intps))
(not (setq exit0 (equal p p0 1e-4)))
)
)
(princ exit0)
exit0
)
;;求直线选择集交点, 滤重复点
(defun lnsinters (ss / n m e1 e2 el el1 p1 p2 p3 p4 intp intps)
(if (and ss (> (sslength ss) 0))(progn
(setq n -1)
(while (setq e1 (ssname ss (setq n (1+ n))))
(setq el (entget e1)
m n
p1 (cdr (assoc 10 el))
p2 (cdr (assoc 11 el))
)
(while (setq e2 (ssname ss (setq m (1+ m))))
(setq el1 (entget e2)
p3 (cdr (assoc 10 el1))
p4 (cdr (assoc 11 el1))
intp (inters p1 p2 p3 p4)
)
(if (and intp (not (CheckSamePoint intp)))
(setq intps (cons intp intps))
)
)
)
))
intps
)
(defun c:tt ()
(princ (lnsinters (ssget)))
(princ)
)
Line选择集交点函数.LSP
posted on 2008-03-12 21:26
深藏记忆 阅读(269)
评论(0) 编辑 收藏 所属分类:
Vlisp之韵