
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Need something that will let me select two points on a polyline and keep the segments in between. This works except if osnap is used when selecting pt1 and pt2...why is that?
(defun traceBetween (/ ensel Pt1 ep1 Pt2 ep2)
(while (setq ensel (entsel "\nSelect line of Polyline <quit>: "))
(if (wcmatch (cdr (assoc 0 (entget (car ensel)))) "LINE,LWPOLYLINE,ARC")
(progn
(setq pt1 (getpoint "\nSelect first point: "))
(setq pt2 (getpoint "\nSelect second point: "))
(if(< (vlax-curve-getdistatpoint (car ensel) pt1) (vlax-curve-getdistatpoint (car ensel) pt2))
(progn
(command "_break" (car ensel) pt1 (vlax-curve-getendpoint (car ensel)))
(command "_break" (car ensel) pt2 (vlax-curve-getstartpoint (car ensel))))
(progn
(command "_break" (car ensel) pt2 (vlax-curve-getendpoint (car ensel)))
(command "_break" (car ensel) pt1 (vlax-curve-getstartpoint (car ensel))))
)
)
)
)
(princ)
)
Solved! Go to Solution.