@Anonymous wrote:
.... if you do a ssget "F" it will draw like a pline over the lines you want to add points to so drag the temp line near the desired end. You end up with a selection of lines.
....
Just drag pline points over the lines near the end of the lines.
You don't actually need to draw a Polyline to do this. The (ssnamex) function "knows" by what method each object in a selection set was selected, and in the case of pick or Fence selection, where it was selected [the pick point, or the place where the Fence crossed it]. So a Point can be placed using ENDpoint Osnap at that location.
If you're willing to be conscious enough to follow the instructions in the prompt [use only individual-pick or Fence selection, including needing to type in the F for the latter], this puts Points at the nearer ends of all objects selected in either of those ways:
(defun C:PAE (/ ss); = Points At Ends
(prompt "\nTo put Points At Ends of objects, BY FENCE OR PICK SELECTION ONLY near desired ends,")
(if (setq ss (ssget))
(foreach entry (ssnamex ss); list of objects and how/where selected
(if (member (car entry) '(1 4)); selected by pick or Fence
(command
"_.point" "_end" (cadr (last entry)); selection location
"_.erase" (cadr entry) "" ; the object
); command
); if
); foreach
); if
(princ)
); defun
It works with Lines, Arcs, Polylines, Splines, Rays, partial Ellipses, Leaders, even Multilines, but could be limited to LINE objects only, or a limited set of objects types, if desired, with a filter for that in the (ssget) function.
If you disobey the instructions and select things with something like a Window, those will be ignored.
Remove or comment out the Erase line if you want to keep the Lines/etc.
If used on multi-segment Polylines or Leaders, since it uses ENDpoint Osnap, it can sometimes find an internal vertex rather than the overall end. Maybe that can be accounted for if desired.
I find that if I pick the same object twice, near each end, or a Fence crosses it twice like that, or a Fence near one end and a pick near the other, it puts only one Point on it, even without the Erasing. It appears to be always at the end nearer to the first of the selections of it, but I'm not positive of that.
Kent Cooper, AIA