 ; Change text or attribute values to upper case
 ; Copyright 1992, 1998, 2001 by Rocket Software Ltd.
 ; Look for a key marked "Caps Lock".
 (defun C:UC (/ ss nn1 nn zz cc)
  (setvar "cmdecho" 0)
  (command "undo" "m")
  (write-line "Select text/blocks to convert to upper case: ")
  (setq ss (ssget))
  (setq num 0)
  (while (setq nn1 (ssname ss num))
         (setq num (1+ num))
         (setq typ (cdr (assoc 0 (setq nn (entget nn1)))))
         (cond ((or (= typ "TEXT") (= typ "MTEXT"))        ; Is entity text?
                (setq zz (cdr (assoc 1 nn)))        ; get text string
                (setq cc (strcase zz))              ; capitalise it
                (entmod (subst (cons 1 cc) (cons 1 zz) nn)))
               ((and (= typ "INSERT") (assoc 66 nn))
                (setq nsav nn1)
                (while (/= "SEQEND" (cdr (assoc 0 (setq nn (entget (setq nn1
                                                            (entnext nn1)))))))
                       (setq zz (cdr (assoc 1 nn)))        ; get text string
                       (setq cc (strcase zz))              ; capitalise it
                       (entmod (subst (cons 1 cc) (cons 1 zz) nn)))
                (entupd nsav))))
 (PRINC))