 ; SZ - text/dimension text/attribute width squeezer.
 ; Copyright 1994 by Rocket Software
 ; Software that works, for people who'd rather not...
 (DEFUN C:SZ (/ nent enam entt typ ifdim tt cc nn)
  (setvar "cmdecho" 0)
  (command "undo" "mark")
  (if (setq enam (car (setq nent (nentsel
                                "Select something which looks like text: "))))
      (setq typ (cdr (assoc 0 (setq entt (entget enam))))))
  (if (or (= "TEXT" typ) (= "ATTDEF" typ) (= "ATTRIB" typ))
      (progn
           (setq ifdim (caar (reverse nent)))
           (setq width (cdr (assoc 41 entt)))
           (if (< width 0.5)
               (setq nuwdth 1.0)
               (setq nuwdth (- width 0.05)))
           (entmod (subst (cons 41 nuwdth) (cons 41 width) entt))
           (write-line (strcat "\nOld width: " (rtos width 2 2)
                               "  New width: " (rtos nuwdth 2 2)))
           (if (or (and (= typ "ATTDEF")
                        (= (type ifdim) 'ENAME))
                   (and (= (type ifdim) 'ENAME)
                        (= (cdr (assoc 0 (entget ifdim))) "DIMENSION")))
               (entupd (cdr (assoc -1 (entget ifdim))))
               (entupd enam)))
      (if enam (write-line "\nWrong entity type.")))
 (princ))