You're welcome.
Here's a small improvement. It expands the crossing rectangle (currently by 1/15 of the view height) and accepts plines, lines, circles, ellipse and splines as the object to be touched.
(defun ptouch (/ a d1 d2 ent entl maxpt minpt newss opl p10 p11 pl ss)
(vl-load-com)
(setvar "ERRNO" 0)
(while (and (not (setq pl (car (entsel "\nSelect edge object: "))))
(/= (getvar "ERRNO") 52))
)
(cond ((and pl (member (cdr (assoc 0 (entget pl)))
'("LWPOLYLINE" "LINE" "ELLIPSE" "SPLINE" "CIRCLE")))
(setq opl (vlax-ename->vla-object pl)
;; expand crossing selection by 1/15th of view height
expd (/ (getvar "VIEWSIZE") 15.0)
)
;; get diagonal points of bbox
(vla-getboundingbox opl 'minpt 'maxpt)
;; convert to point lists
(mapcar 'set '(minpt maxpt)
(mapcar 'vlax-safearray->list (list minpt maxpt)))
;; expand points
(setq minpt (mapcar '- minpt (list expd expd))
maxpt (mapcar '+ maxpt (list expd expd)))
;; go select lines
(cond ((setq ss (ssget "C" minpt maxpt '((0 . "LINE"))))
;; remove self - if self was a line
(ssdel pl ss)
;; init counter and new sset
(setq a 0 newss (ssadd))
(repeat (sslength ss)
(setq ent (ssname ss a)
entl (entget ent)
p10 (cdr (assoc 10 entl))
p11 (cdr (assoc 11 entl))
a (1+ a)
)
;; find closest point and compare distances
(setq d1 (vlax-curve-getclosestPointTo opl p10 T)
d2 (vlax-curve-getclosestPointTo opl p11 T))
(and (or (equal (distance p10 d1) 0.0 1e-6)
(equal (distance p11 d2) 0.0 1e-6))
(ssadd ent newss)
)
)
)
)
(vlax-release-object opl)
)
)
(if (and newss (> (sslength newss) 0)) newss)
)
To adjust expansion, change the divisor at the (getvar "VIEWSIZE") statement .. or just remove it along with setq'ing minpt and maxpt.
To adjust fuzz factor for point 'closeness', adjust the fuzz factor in the EQUAL conditions.