Sorry, it was written quickly... Here is better revision...
(defun c:checkoverlappts ( / unique c1 c2 fuzz int pt pl d1 d2 p1c1 p2c1 p1c2 p2c2 ol )
(vl-load-com)
(defun unique ( l )
(if l
(cons (car l) (unique (vl-remove-if '(lambda ( x ) (equal x (car l) 1e-8)) l)))
)
)
(while
(or
(not (setq c1 (car (entsel "\nPick first curve for checking..."))))
(if c1
(vl-catch-all-error-p (vl-catch-all-apply 'vlax-curve-getstartpoint (list c1)))
)
)
(prompt "\nMissed or picked wrong entity type...")
)
(while
(or
(not (setq c2 (car (entsel "\nPick second curve for checking..."))))
(if c2
(vl-catch-all-error-p (vl-catch-all-apply 'vlax-curve-getstartpoint (list c2)))
)
)
(prompt "\nMissed or picked wrong entity type...")
)
(initget 6)
(setq fuzz (getdist "\nPick or specify checking fuzz distance <0.01> : "))
(if (null fuzz)
(setq fuzz 0.01)
)
(setq int (vlax-invoke (vlax-ename->vla-object c1) 'intersectwith (vlax-ename->vla-object c2) acextendnone))
(if (or (equal (vlax-curve-getstartpoint c1) (vlax-curve-getstartpoint c2) 1e-8) (equal (vlax-curve-getstartpoint c1) (vlax-curve-getendpoint c2) 1e-8))
(setq pl (cons (vlax-curve-getstartpoint c1) pl))
)
(if (or (equal (vlax-curve-getendpoint c1) (vlax-curve-getstartpoint c2) 1e-8) (equal (vlax-curve-getendpoint c1) (vlax-curve-getendpoint c2) 1e-8))
(setq pl (cons (vlax-curve-getendpoint c1) pl))
)
(if (or int pl)
(progn
(if int
(repeat (/ (length int) 3)
(setq pt (list (car int) (cadr int) (caddr int)))
(setq int (cdddr int))
(setq pl (cons pt pl))
)
)
(foreach pt (setq pl (unique (vl-sort pl '(lambda ( a b ) (< (vlax-curve-getparamatpoint c1 a) (vlax-curve-getparamatpoint c1 b))))))
(setq d1 (vlax-curve-getdistatpoint c1 pt))
(setq d2 (vlax-curve-getdistatpoint c2 pt))
(setq p1c1 (vlax-curve-getpointatdist c1 (- d1 fuzz)))
(setq p2c1 (vlax-curve-getpointatdist c1 (+ d1 fuzz)))
(setq p1c2 (vlax-curve-getpointatdist c2 (- d2 fuzz)))
(setq p2c2 (vlax-curve-getpointatdist c2 (+ d2 fuzz)))
(if (or (and p1c1 p1c2 (equal p1c1 p1c2 1e-8)) (and p1c1 p2c2 (equal p1c1 p2c2 1e-8)) (and p2c1 p1c2 (equal p2c1 p1c2 1e-8)) (and p2c1 p2c2 (equal p2c1 p2c2 1e-8)))
(setq ol (cons pt ol) pl (vl-remove pt pl))
)
)
(prompt "\nIntersection points that don't overlap : ") (princ pl)
(prompt "\nIntersection points that overlap : ") (princ (setq ol (reverse ol)))
)
(prompt "\nPicked curves don't intersect each other...")
)
(princ)
)
Regards, M.R.
Thanks...
Marko Ribar, d.i.a. (graduated engineer of architecture)