home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 December / PCWKCD1296.iso / demo / wgelectr / cameval / cam31 / misc.z / SMP_PNL.SCR < prev    next >
Text File  |  1995-07-13  |  4KB  |  165 lines

  1. ; Automatic Panelization Script
  2. ; Version 2.2
  3. ; Date: 7/13/95
  4.  
  5. view_toolbar@
  6.            
  7. ; are you using camware.
  8. ok_cancel "Are you running CAMWare?", cware
  9. if cware = 0 then goto 5
  10. print_msg "Macro exiting -- Cannot run in CAMWare mode..."
  11. delay 1500
  12. end
  13.  
  14. 5
  15. ; if there is no drill layer, quit the program.
  16. if drilllayer! = -1 then goto 900
  17.  
  18. ; Find the TOP layer
  19. print_msg "Finding the TOP layer  --  Please wait..."
  20. toplayer = 0
  21. for a = 0 to 32
  22.     setlayer@ a
  23.     if layertype! > 0 then goto 10
  24.     toplayer = a
  25.     a = 32
  26. 10 next
  27.  
  28. ; Subroutine 100 computes the min dcode used in draws.
  29. print_msg "Find the smallest dcode used in draws..."
  30. gosub 100
  31.  
  32. ; Subroutine 200 computes the min dcode used in flashes.
  33. print_msg "Find the smallest dcode used in flashes..."
  34. gosub 200
  35.  
  36. ; Do a panelization according to the filmsize.
  37. print_msg "Panelizing", dbname!
  38. panel_spread@ 0,0
  39. panel_spacing@ 1000,1000,500,500,0
  40. panel_dimension@ filmmaxx!-filmminx!,filmmaxy!-filmminy!
  41. autogen = 0
  42. blayer = borderlayer!
  43. if blayer = -1 then autogen = 1
  44. if blayer = -1 then blayer = blanklayer!
  45. tempdcode = blankdcode!
  46. edit_aperture@ tempdcode,1,5,5,tempdcode
  47. panel_outline@ autogen,tempdcode,blayer,0.0
  48. panelization@ 
  49.  
  50. ; Save the database extent.
  51. minx = dbminx!
  52. maxx = dbmaxx!
  53. miny = dbminy!
  54. maxy = dbmaxy!
  55.  
  56. ; Draw test coupon at appr. lower center of the panel.
  57. setdcode@ tempdcode
  58. setlayer@ borderlayer!
  59. boxstartx = (minx+maxx)/2 - 500;
  60. boxstarty = miny + 500;
  61. add_rectangle@
  62. axy@ boxstartx,boxstarty
  63. axy@ boxstartx+1000,boxstarty+500
  64. back@
  65.  
  66. ; Draw 4 lines.
  67. setdcode@ drawdcode
  68. setlayer@ toplayer
  69. add_line@
  70. for i = 1 to 4
  71.   newy = boxstarty + (i*100)
  72.   axy@ boxstartx+100, newy
  73.   axy@ boxstartx+800, newy
  74.   back@
  75. next
  76. back@
  77.  
  78. ; Draw 4 flashes.
  79. setdcode@ flashdcode
  80. add_flash@
  81. for i = 1 to 4
  82.   newy = boxstarty + (i*100)
  83.   axy@ boxstartx+900, newy
  84. next
  85. back@
  86.  
  87. ; Draw drill coupons at upper left and lower right of panel.
  88. setdcode@ tempdcode
  89. setlayer@ borderlayer!
  90. ulboxstartx = minx + 500;
  91. ulboxstarty = maxy - 500;
  92. lrboxstartx = maxx - 3000;
  93. lrboxstarty = miny + 500;
  94. add_rectangle@
  95. axy@ ulboxstartx,ulboxstarty
  96. axy@ ulboxstartx+2500,ulboxstarty-500
  97. axy@ lrboxstartx,lrboxstarty
  98. axy@ lrboxstartx+2500,lrboxstarty+500
  99. back@
  100.  
  101. ; Draw first 10 drill legend.
  102. setlayer@ drilllayer!
  103. print_msg "Draw first 10 drill legend..."
  104. for i = 1 to 10
  105.   set_drill_tool@ i
  106.   if drilllegend! = 0 then goto 1000
  107.   ulnewx = ulboxstartx + (i*250)
  108.   lrnewx = lrboxstartx + (i*250)
  109.   set_adddrill@ i
  110.   util_drill_addhit@
  111.   axy@ ulnewx,(ulboxstarty-250)
  112.   util_drill_addhit@
  113.   axy@ lrnewx,(lrboxstarty+250)
  114. back@
  115. next
  116. back@
  117.  
  118. ; Zoom home and quit.
  119. 1000
  120. view_all@
  121. print_msg "Drill Sort..."
  122. drill_sort_set@ 0,tempdcode,50, drilllayer!
  123. drill_sort@ 0,0,0,0
  124. print_msg "Zoom Home..."
  125. close_msg
  126. view_toolbar@
  127. end
  128.  
  129. ; If there is no drill data, give a warning and end here.
  130. 900
  131. view_toolbar@
  132. print "No drill layer! Macro Exits."
  133. end
  134.  
  135. ; This subroutine goes through the whole aperture table and
  136. ; computes the minimum dcode used to in draws.
  137. 100
  138. drawdcode = 10;
  139. size = 1000
  140. for i = 10 to highestdcode!
  141.   setdcode@ i
  142.   if dcodeshape! = 0 then goto 101
  143.   if dcodesizex! > size then goto 101
  144.   if numdraws! = 0 then goto 101
  145.   size = dcodesizex!
  146.   drawdcode = i
  147. 101 next
  148. return
  149.  
  150. ; This subroutine goes through the whole aperture table and
  151. ; computes the minimum dcode used to in flashes.
  152. 200
  153. flashdcode = 10;
  154. size = 1000
  155. for i = 10 to highestdcode!
  156.   setdcode@ i
  157.   if dcodeshape! = 0 then goto 201
  158.   if dcodesizex! > size then goto 201
  159.   if numflashes! = 0 then goto 201
  160.   size = dcodesizex!
  161.   flashdcode = i
  162. 201 next
  163. return
  164.  
  165.