 ; Urb: mirror blocks to fix flipped x and y scales.
 ; Copyright 1993, 2013 by Rocket Software Ltd.
 ; Software: the third version is what they promised the first would be.
 ; But you still have to pay for upgrades.
 (DEFUN C:URB (/ rad ss num so blok pa xsc ysc zsc rota)
  (setvar "cmdecho" 0)
  (command "undo" "be")
  (setq rad (/ (getvar "viewsize") 25))
  (write-line "\nBlocks to De-Mirror: ")
  (setq ss (ssget (list (cons 0 "INSERT"))))
  (setq num 0)
  (while (and ss (setq so (ssname ss num)))
         (setq num (1+ num))
         (setq blok (entget so))
         (setq pa (cdr (assoc 10 blok)))    ; insertion point
         (setq xsc (cdr (assoc 41 blok)))   ; x scale
         (setq ysc (cdr (assoc 42 blok)))   ; y scale
         (setq zsc (cdr (assoc 43 blok)))   ; z scale
         (setq rota (cdr (assoc 50 blok)))  ; rotation angle
         (cond ((minusp xsc)
                (setq pb (polar pa (+ (/ pi 2) rota) 2))
                (command "mirror" so "" pa pb "Y"))
               ((minusp ysc)
                (setq pb (polar pa rota 2))
                (command "mirror" so "" pa pb "Y")))
          (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))
 (princ))