home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 58 / af058b.adf / PV21.lha / REXX / TouchLineWeights.pvrx < prev    next >
Text File  |  1991-07-22  |  2KB  |  69 lines

  1. /* TouchLineWeights.pvrx---bumps all lineweights below minimum to
  2.     quarter point to prevent lines dropping out at
  3.     1200-2400 DPI.  Changes objs with same FillVal and
  4.     EdgeVal to No line.
  5.  
  6.     Copyright © 1991 Stylus, Inc. 
  7.     Author: Jeff Blume
  8. */
  9.  
  10. /* Try to get exclusive lock on project window.
  11.     If can't get lock, not safe to proceed. */
  12. 'Lock'
  13. if rc ~= 0 then exit
  14.  
  15. options results
  16.  
  17. /* Prompt user for minimum line weight */
  18. 'GetStr "Min. line weight in inches; OK=.25pt" "OK" "CANCEL"'
  19. LWmin = result
  20. if rc ~= 0 then call CleanUp
  21. if LWmin = "" then LWmin = .00346  /* default to .25pt  */
  22.  
  23. 'Prompt "Working..."'
  24. 'PushUndo'
  25.  
  26. /* Walk layer list to get all objects; SelExtent of page
  27. would not include object partially off page... */
  28. 'GetLayers' LayList;    LayNum = result
  29. do i = 0 to LayNum-1        /* Loop on Layer List */
  30.     'FirstObj' LayList.i;    Obj.0 = result
  31.     call TestLW Obj.0
  32.     do j = 1 until rc ~= 0    /* rc~=0 proper test for end of list? */
  33.         k = j - 1
  34.         'NextObj' Obj.k; Obj.j = result
  35.         call TestLW Obj.j
  36.     end
  37. end
  38.  
  39. 'EndPrompt'
  40.  
  41. CLEANUP:
  42. /* Render the area operated upon, and free the project window
  43.     This sequence is recommended to finish up most macros */
  44. 'Repair'
  45. 'UnLock'
  46. exit
  47.  
  48. TESTLW:
  49.     arg TestObj
  50.     /* Get relevant attributes */
  51.     'EdgeWidth' TestObj;    ObjEdgeWidth = Result
  52.     'EdgeVal' TestObj;    ObjEdgeVal = Result
  53.     'FillType' TestObj;    ObjFillType Result
  54.     'FillVal' TestObj;    ObjFillVal = Result
  55.     if ObjEdgeWidth<LWmin & ObjFillType=1 & ObjFillVal=ObjEdgeVal then
  56.             do
  57.                 'SaveUndo' TestObj
  58.                 'ChangeEdgeType' TestObj 0
  59.             end
  60.     else if ObjEdgeWidth < LWmin then
  61.         do
  62.             'SaveUndo' TestObj
  63.             'ChangeEdgeWidth' TestObj LWmin
  64.         end
  65.  
  66. /* Made smarter to test for filled objects with same
  67. border color and sets to NOLINE). Presumes line weight less
  68. than the minimum is insignificant. */
  69.