;|
********************************************
* CHRAD.LSP - (c) 1998 Tee Square Graphics *
********************************************

Two utilities to globally change the radius of existing
  circles in an AutoCAD drawing.

CAUTION: This is "demonstration" level software, and has no
  error traps or other refinements. These enhancements are
  left to the discretion of the end user. Both of the commands
  defined below will select ALL circles of the chosen "old
  radius" and change all to the "new radius." To allow the
  user to select a superset of objects to be scanned, remove
  the "x" from the (ssget...) function in either case:

  (setq ss (ssget (list '(0 . "CIRCLE")(cons 40 or))))

********************************************

CHRAD command uses (command...) function and appears to be
  somewhat faster where the change of radius is fairly small.
|;
(defun C:CHRAD (/ or nr ss)
  (setq ce (getvar "cmdecho")
        or (getdist "\nOld radius: ")
        nr (getdist "\nNew radius: ")
        ss (ssget "x" (list '(0 . "CIRCLE")(cons 40 or))))
  (if ss
    (progn
      (setvar "cmdecho" 0)
      (command "_.change" ss "" "" nr)
      (while (= (logand (getvar "cmdactive") 1) 1)
        (command nr))
      (setvar "cmdecho" ce))
    (alert (strcat "No " (rtos or) " radius circles found.")))
  (princ)
)
;|

********************************************

CHRAD1 command uses (entmod...) and is considerably
  faster where the change of radius is large.
|;
(defun C:CHRAD1 (/ or nr ss n obj)
  (setq or (getdist "\nOld radius: ")
        nr (getdist "\nNew radius: ")
        ss (ssget "x" (list '(0 . "CIRCLE")(cons 40 or)))
        n 0)
  (if ss
    (while (< n (sslength ss))
      (setq obj (entget (ssname ss n))
            obj (subst (cons 40 nr)(assoc 40 obj) obj)
            n (1+ n))
      (entmod obj))
    (alert (strcat "No " (rtos or) " radius circles found.")))
  (princ)
)