home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 58 / af058b.adf / PV21.lha / REXX / Origin.pvrx < prev    next >
Text File  |  1991-09-21  |  988b  |  39 lines

  1. /* Origin.pvrx---This macro will get the coordinates of the upper-left
  2.     corner of the bounding box of all selected objects, and move those
  3.     objects so that the new coordinates for the corner of the bounding
  4.     box are 0,0 (usually the upper-left corner of the project window).
  5.     This can be useful if the project page is to reDIMENSIONed, etc.
  6. Copyright © 1989 by Taliesin, Inc.
  7. Author: Jeff Blume & Ross Cunniff
  8. Usage:  Assign to Ctrl-Key or RX tool 
  9.     The macro expects to find at least one selected object. */
  10.  
  11. options results
  12.  
  13. /* Try to get exclusive lock on project window.
  14.     If can't get lock, not polite to interrupt. */
  15. 'Lock'
  16. if rc ~= 0 then exit
  17.  
  18. /* Find Delta's to Origin */
  19. 'SelExtent' Ext
  20. if RC ~= 0 then call ERROR "No object selected!"
  21. DX = -Ext.X1; DY = -Ext.Y1
  22.  
  23. 'SelectList' Sel; SelN = Result
  24.  
  25. 'PushUndo'
  26. do i = 0 to SelN-1
  27.     'Move'  Sel.i DX DY 
  28. end
  29.  
  30. 'Repair'
  31.  
  32. ERROR:
  33.     arg ErrTxt
  34.     if RC ~= 0 | ErrTxt ~= "" then do
  35.         'GetBool ErrTxt "Cancel" "Cancel"' 
  36.         end
  37.     'UnLock'
  38.     exit
  39.