 ; Brot - rotate all blocks of one type 180ø.
 ; Copyright 1995, 1997, 2001 by Rocket Software Ltd.
 ; Why can't you get a mirror with static and intermittent vertical hold?
 (DEFUN C:BROT ( / goon hi num bl ss rad len so txa namlst namm pa)
  (setvar "cmdecho" 0)
  (setq namm (getstring "Block to rotate or <Return> to select: "))
  (if (= namm "")
      (progn
           (setq namm (entsel "Select a block: "))
           (while (null goon)
                  (cond ((null namm)
                         (setq namm (entsel "\nHave another shot: ")))
                        ((not (setq namm (cdr (assoc 2 (setq entt
                                                       (entget (car namm)))))))
                         (setq namm (entsel "\nThat wasn't a block: ")))
                        (T
                         (setq goon T))))))
  (setq namm (strcat (strcase (substr namm 1 1)) (strcase (substr namm 2) t)))
  (setq ss (ssget "X" (list (cons 2 namm))))
  (if ss
     (progn
          (setq rad (/ (getvar "viewsize") 25))
          (setq len (strcat "/" (itoa (sslength ss))))
          (prompt (strcat "\n" namm " inserts found: " (itoa (sslength ss))))
          (setq num 0)
          (while (setq so (ssname ss num))
                 (setq txa (entget so))
                 (setq num (1+ num))
                 (grtext -2 (strcat (itoa num) len))
                 (setq pa (cdr (assoc 10 txa)))
                 (grdraw (polar pa (/ pi 4) rad)
                         (polar pa (* 1.25 pi) rad) 7)
                 (grdraw (polar pa (* pi 0.75) rad)
                         (polar pa (* pi 1.75) rad) 7)
                 (command "rotate" so "" pa "180")))
    (write-line (strcat "\nNo " namm " insertions found. ")))
 (princ))