@Kent1Cooper wrote:
.... Back later with a generic routine to draw Circles at both ends of any kind of object....
Here's one that does that [lightly tested], on any Line, Polyline, Arc, Circle, Ellipse, Spline or Ray, as long as you continue to pick things:
(defun C:CatE (/ rad ss ent); = Circle(s) at End(s)
(initget (if *CatErad* 0 1)); no Enter on first use
(setq *CatErad*
(cond
( (getdist
(strcat
"\nRadius of Circle(s) to draw at End(s)"
(if *CatErad* (strcat " <" (rtos *CatErad*) ">") "")
": "
); strcat
); getdist
); User-input condition
(*CatErad*); on Enter with prior value
); cond
); setq
(while (setq ss (ssget "_+.:S" '((0 . "*LINE,ARC,CIRCLE,ELLIPSE,RAY"))))
(command "_.circle" "_none" (vlax-curve-getStartPoint (setq ent (ssname ss 0))) *CatErad*)
(if (not (or (vlax-curve-isClosed ent) (member '(0 . "RAY") (entget ent))))
(command "_.circle" "_none" (vlax-curve-getEndPoint (setq ent (ssname ss 0))) *CatErad*)
); if
); while
(princ)
); defun
On closed things and Rays, it puts just one, at the start/end point of closed things. It could be made to disallow closed things if preferred, to draw Circles only on open ends. It could be made to either disallow or work differently with MLINEs if you might ever have those [currently it would allow selection of one, but couldn't draw the Circles with this method].
It ends if you hit Enter/space/ESCape, or pick an inappropriate object type, or just miss, but it could be made to account for the latter two conditions and ask again. It draws the Circles on the current Layer, but could be made to set a built-in Layer, or ask the User, or use the Layer of the selected object. And of course it could have *error* handling added, command-echo suppression, Undo begin/end wrapping, etc.
Kent Cooper, AIA