Message 1 of 12
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
As you may know, I have been trying to create @braudpat's function for adding vertices at every midpoint of a polyline's segments.
It is failing occasionally when trying to get the midpoint of the last segment.
Does anyone know why? This is not a quiz. I haven't a clue.
Try this test on any, in fact many, poylines (LW, heavy, 3D, closed, open) and see what you get.
In some situations, the midpoint of the last segment is returned as nil.
(defun c:test () (and (setq e (car (entsel))) (setq obj (vlax-ename->vla-object e)) (setq objname (vlax-get obj 'ObjectName)) (or (wcmatch objname "*olyline") (alert "Object selected is not a polyline.") ) (princ "\nClosed: ")(princ (vlax-get obj 'Closed)) (setq end (vlax-curve-getendparam obj)) (princ " Midpoint of last segment: ") (princ (setq p (vlax-curve-getpointatparam obj (- end 0.5)))) ) (princ) )
John F. Uhden
Solved! Go to Solution.