;  ZOOMBACK.LSP
 ;
 ;                         QUICK COMMAND Release 3.0
 ;                   ZOOMBACK.LSP is a module of QUICK COMMAND
;                       Copyright 1989, 90, 92 Dan Jincks
 ;
 ;
;              This is SHAREWARE, it is NOT Public Domain software.
 ;
 ;              This code or any part of this code may not be reproduced
 ;              in any publication without prior written permission.
 ;
 ;              Printed copy of this code or any part of this code may not
 ;              be distributed without prior written permission.
 ;
 ;              Printed copy may only be made for reference purposes by
 ;              the end user.
 ;
 ;
 ;                               Dan Jincks
 ;                             Box 155A HCR 77
 ;                           Annapolis, MO 63620
 ;
 ;
 ;
 ;   You are granted a limited license to use ZOOMBACK.LSP for a 30 day trial
 ;   period.  If you wish to continue using any or all of QUICK COMMAND after
 ;   the trial period, you must become a registered user.  As a registered
 ;   user, you may use QUICK COMMAND on 1 workstation or terminal.
 ;   Additional registrations must be bought for each additional workstation or
 ;   terminal.  To become a registered user, see QC3.DOC
 ;
 ;
 ;   You may send copies of QUICK COMMAND to friends and associates if you abide
 ;   by the following rules:
 ;
 ;   1. It may only be distributed in the original unmodified form.
 ;   2. All original files must be included.
 ;   3. No addition files may be added.
 ;   4. If other files will be on the same disk, QUICK COMMAND files must be in
 ;      a library format such as ".ARC" called "QUICKCMD", or else be put alone
 ;      in a subdirectory called "QUICKCMD".
 ;   5. You may not sell QUICK COMMAND or any part of it.
 ;   6. You are not allowed to charge more then $5 to cover the cost of copying
 ;      and distribution.
 ;   7. You may not distribute any hard copy of the contents of QUICK COMMAND.
 ;
 ;
 ;   These AutoLISP commands and functions are designed to save you time, and
 ;   saving time means saving money.  The registration fee is very modest
 ;   compared to the savings, and much less expensive then typical third party
 ;   AutoCAD software. Be sure to registar if you continue to use them.
 ;
 ;
 ;                                                               DAN
 ;
 ;
 ;
 ;
 ;        AutoCAD and AutoLISP are registered trade marks of Autodesk Inc.
 ;
 ;        ***************************************************************
 ;
 ;   Begin ZOOMBACK.LSP
 ;

;  ZB function

(defun C:ZB (/ SCA SCB SCC SCD SCE SCF SCG SCH)
   (setq SCA (getvar "vsmax") SCB (getvar "vsmin"))
   (if (and (> (car SCA)(car SCB))(> (cadr SCA)(cadr SCB)))(progn
      (setq SCG (* (- (car SCA)(car SCB)) 0.001)
            SCH (* (- (cadr SCA)(cadr SCB)) 0.001)
            SCC (- (car SCA) SCG)
            SCD (- (cadr SCA) SCH)
            SCE (+ (car SCB) SCG)
            SCF (+ (cadr SCB) SCH))
   ))
   (if (and (< (car SCA)(car SCB))(> (cadr SCA)(cadr SCB)))(progn
      (setq SCG (* (- (car SCB)(car SCA)) 0.001)
            SCH (* (- (cadr SCA)(cadr SCB)) 0.001)
            SCC (+ (car SCA) SCG)
            SCD (- (cadr SCA) SCH)
            SCE (- (car SCB) SCG)
            SCF (+ (cadr SCB) SCH))
   ))
   (if (and (> (car SCA)(car SCB))(< (cadr SCA)(cadr SCB)))(progn
      (setq SCG (* (- (car SCA)(car SCB)) 0.001)
            SCH (* (- (cadr SCB)(cadr SCA)) 0.001)
            SCC (- (car SCA) SCG)
            SCD (+ (cadr SCA) SCH)
            SCE (+ (car SCB) SCG)
            SCF (- (cadr SCB) SCH))
   ))
   (if (and (< (car SCA)(car SCB))(< (cadr SCA)(cadr SCB)))(progn
      (setq SCG (* (- (car SCB)(car SCA)) 0.001)
            SCH (* (- (cadr SCB)(cadr SCA)) 0.001)
            SCC (+ (car SCA) SCG)
            SCD (+ (cadr SCA) SCH)
            SCE (- (car SCB) SCG)
            SCF (- (cadr SCB) SCH))
   ))
   (if (and SCC SCD SCE SCF)
      (command "ZOOM" "W" (list SCC SCD)(list SCE SCF))
      (prompt " Equal X or Y at corners of screen. Can't zoom.")
   )(princ)
)
 ;
 ;   End ZOOMBACK.LSP
