home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 58 / af058b.adf / PV21.lha / REXX / Mirror.pvrx < prev    next >
Text File  |  1991-06-06  |  1KB  |  64 lines

  1. /* Mirror.pvrx---This macro will flip the selected objects along the axis
  2.     specified by the user, 'X,' 'Y,' and 'XY.'
  3. Copyright © 1989 by Taliesin, Inc.
  4. Author: Jeff Blume & Ross Cunniff
  5. Usage:  Assign to Ctrl-Key or RX tool 
  6.     The macro expects to find at least one selected object. */
  7.  
  8. options results
  9.  
  10. /* Try to get exclusive lock on project window.
  11.     If can't get lock, not polite to interrupt. */
  12. 'Lock'
  13. if rc ~= 0 then exit
  14.  
  15. 'GetStr "Axis (X Y or XY)?" "OK" "Cancel"'
  16. Axis = Result
  17. if RC ~= 0 | Axis = "" then call CLEANUP
  18.  
  19. 'SelectList' Sel; SelN = Result
  20. if SelN = 0 then call ERROR "No selected objects!"
  21.  
  22. 'PushUnDo'
  23.  
  24. /* Determine requested axis */
  25. select
  26.     when upper(Axis) = "X" then call XFLIP
  27.     when upper(Axis) = "Y" then call YFLIP
  28.     when upper(Axis) = "XY" then call XYFLIP
  29.     otherwise call Error 'X Y or XY !'
  30. end
  31.  
  32. XFLIP:
  33.     do i = 0 to SelN-1
  34.         'ObjExtent' Sel.i Ext
  35.         'Size' Sel.i Ext.X1 Ext.Y1 "-1" "1"
  36.     end
  37.  
  38. call CLEANUP
  39.  
  40. YFLIP:
  41.     do i = 0 to SelN-1
  42.         'ObjExtent' Sel.i Ext
  43.         'Size' Sel.i Ext.X1 Ext.Y1 "1" "-1"
  44.     end
  45.  
  46. call CLEANUP
  47.  
  48. XYFLIP:
  49.     do i = 0 to SelN-1
  50.         'ObjExtent' Sel.i Ext
  51.         'Size' Sel.i Ext.X1 Ext.Y1 "-1" "-1"
  52.     end
  53.  
  54. CLEANUP:
  55.     'Repair'
  56.  
  57. ERROR:
  58.     arg ErrTxt
  59.     if RC ~= 0 | ErrTxt ~= "" then do
  60.         'GetBool ErrTxt "Cancel" "Cancel"' 
  61.         end
  62.     'UnLock'
  63.     exit
  64.