I use LM:intersections often, but sometimes the result is not as intended.
(defun c:inter ( / obj1 obj2 )
(if (and (setq obj1 (car (entsel "\nSelect 1st Object: ")))
(setq obj2 (car (entsel "\nSelect 2nd Object: ")))
)
(foreach pnt (LM:intersections (vlax-ename->vla-object obj1) (vlax-ename->vla-object obj2) acextendnone)
(entmake (list '(0 . "POINT") (cons 10 pnt)))
)
)
(princ)
)
(defun LM:Intersections ( obj1 obj2 mode / l r )
(setq l (vlax-invoke obj1 'intersectwith obj2 mode))
(repeat (/ (length l) 3)
(setq r (cons (list (car l) (cadr l) (caddr l)) r)
l (cdddr l)
)
)
(reverse r)
)
I attached the drawing, I use a UTM System Coordinate, the result: the point lies not on the Polyline.
I don't have this problem if the objects are situated near (0,0) (I use Autocad 2009).
Anyone can help me solve this problem?
I am thinking about working in UCS and transform the result back to WCS but I don't have any knowledge of this and right now need a fast solution.
Any pointer or help will be appreciated. Thanks