 ; Muddle - middle justify text without changing its position.
 ; Copyright 1992, 2003 by Rocket Software Ltd.
 ; Rocket - software for confused drawings.
 (DEFUN MILT (enam / aa ten new10 dist angl new11 nu11)
  (setq aa (entget enam))
  (setq ten (cdr (assoc 10 aa)))                   ; starting 10 pos
  (setq aa (subst (cons 72 4) (assoc 72 aa) aa))   ; change to M
  (entmod (subst (cons 73 0) (assoc 73 aa) aa))    ; change MM to M normal
  (setq aa (entget enam))                          ; get the changed ent. data
  (setq new10 (cdr (assoc 10 aa)))                 ; new 10 point
  (setq dist (distance ten new10))                 ; distance moved
  (setq angl (angle new10 ten))                    ; and angle
  (setq new11 (cdr (assoc 11 aa)))                 ; new centre point
  (setq nu11 (polar new11 angl dist))              ; move centre same as 10 was
  (entmod (subst (cons 11 nu11) (assoc 11 aa) aa))
 (princ))

 (DEFUN C:MUDDLE (/ ss num enam)
  (setvar "cmdecho" 0)
  (command "undo" "be")
  (if (setq ss (ssget (list (cons 0 "text"))))
      (progn
           (setq num 0)
           (while (setq enam (ssname ss num))
                  (setq num (1+ num))
                  (milt enam))))
  (write-line (strcat (itoa num) " text entit"
                      (if (= num 1) "y" "ies") " rejustified."))
  (command "undo" "end")
 (princ))