Another way [in simplest terms]:
(defun C:S2C (/ ss n spl LL UR)
(if (setq ss (ssget '((0 . "SPLINE"))))
(repeat (setq n (sslength ss))
(setq spl (ssname ss (setq n (1- n))))
(vla-getboundingbox (vlax-ename->vla-object spl) 'minpt 'maxpt)
(setq
LL (vlax-safearray->list minpt)
UR (vlax-safearray->list maxpt)
)
(command
"_.circle" "_non" (mapcar '/ (mapcar '+ LL UR) '(2 2 2)) (/ (- (car UR) (car LL)) 2)
"_.erase" spl ""
)
)
)
(prin1)
)
It uses the centers of the bounding boxes for the Circles' centers, and half the width of that for their radii. It's up to you to select appropriate Splines, but it could be made to check for certain things, such as that the bounding box at least has the same width and height [within some tolerance]. It draws the Circle(s) on the current Layer, but could put each on the same Layer as its source Spline. Etc., etc.
Kent Cooper, AIA