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

  1. ; Tool Chart Script
  2. ; Gordon W. Widera
  3. ; 13 / June / 1994
  4.  
  5. ;
  6. ; If there is no drill layer, quit the program.
  7. ;
  8. If drilllayer! < 0 then goto 999
  9.  
  10. ;
  11. ; Create a dcode to draw with.
  12. ;
  13. tempdcode = blankdcode!
  14. Edit_aperture@ tempdcode,1,5,5,tempdcode,""
  15.  
  16. ;
  17. ; Define text.
  18. ;
  19. Textheight@ 75.0000
  20. Textangle@ 0
  21. Textcspace@ 20.0000
  22. Textlspace@ 100.0000
  23. Textmirror@ 0
  24. Textfitting@ 0
  25. Textjust@ 5
  26.  
  27. ;
  28. ; Declair variables
  29. ;
  30. a = 0
  31. p = 100
  32. q = 200
  33. line = 0
  34. bar = 0
  35. layer = 0
  36. tool = 0
  37. banx = 0
  38. bany = 0
  39. space1$ = " "
  40. space4$ = "    "
  41.  
  42. ;
  43. ; Save the database extent.
  44. ;
  45. minx = dbminx!
  46. maxx = dbmaxx!
  47. miny = dbminy!
  48. maxy = dbmaxy!
  49.  
  50. ;
  51. ; Count up the number of drill tools.
  52. ;
  53. For a = 1 to 99
  54. set_drill_tool@ a  
  55. If drillsize! = 0 then goto 400
  56. tool = tool + 1
  57. next
  58.  
  59. ;
  60. ; Set the active layer.
  61. ;
  62. 400
  63. Setlayer@ blanklayer!, "Chart.gbr"
  64. ;Setlyaer@ activelayer!, "Chart.gbr"
  65. ;edit_layer blanklayer!,11,11,0,0,"Chart.gbr"
  66. update_layerbar@
  67.  
  68. ;
  69. ; Set the distance from the board border.
  70. ;
  71. Input "Enter an offset from the board border (mills).", offset
  72.  
  73. ;
  74. ; Set tool chart placement.
  75. ;
  76. 200
  77. Input "Place Tool Chart, Left/Right or Top/Bottom.", side$
  78. If side$ = "L" then goto 100
  79. If side$ = "l" then goto 100
  80. If side$ = "R" then goto 110
  81. If side$ = "r" then goto 110
  82. If side$ = "T" then goto 150
  83. If side$ = "t" then goto 150
  84. If side$ = "B" then goto 160
  85. If side$ = "b" then goto 160
  86. Print "That was not a valid entry. Please try again." 
  87. goto 200
  88.  
  89. 110
  90. maxy = dbmaxy!
  91. banx = (maxx + offset)
  92. bany = ((maxy + (tool * 100)) / 2)
  93. goto 300
  94.  
  95. 100
  96. maxy = dbmaxy!
  97. banx = ((minx - 2600) - offset)
  98. bany = ((maxy + (tool * 100)) / 2)
  99. goto 300
  100.  
  101. 150
  102. banx = ((maxx / 2) - 1300)
  103. bany = (maxy + (((tool * q) + 100) + offset))
  104. goto 300
  105.  
  106. 160
  107. banx = ((maxx / 2) - 1300)
  108. bany = ((miny - 300) - offset)
  109.  
  110. ;
  111. ; Draw tool chart header.
  112. ;
  113. 300
  114. Setdcode@ tempdcode
  115. Add_line@
  116. axy@ (banx),(bany + 300)
  117. axy@ (banx + 2600),(bany + 300)
  118. Setdcode@ tempdcode
  119. Add_text@
  120. Addtext@ banx,(bany + 200),0,0, "            Tool Chart            "
  121. Add_line@
  122. axy@ (banx),(bany + 100)
  123. axy@ (banx + 2600),(bany + 100)
  124. Back@
  125. Setdcode@ tempdcode
  126. Add_text@
  127. Addtext@ banx,(bany),0,0, " No.  Size(mils)   Count   Legend"
  128. Back@
  129.  
  130. ;
  131. ; Draw tool information.
  132. ;
  133. For n = 1 to 99
  134.   setdcode@ tempdcode
  135.   set_drill_tool@ n  
  136.     If drilllegend! = 0 then goto 900
  137.     line = line + 1     
  138.       x$ = n
  139.       y$ = drillsize!
  140.       z$ = drillcount!
  141.       out$ = space1$ + x$ + space4$ + y$ + space4$ + z$   
  142.       addtext@ (banx),(bany - (line * q)),0,0, out$
  143.     Add_line@
  144.     axy@ (banx),(bany - ((line * q) - p))
  145.     axy@ (banx + 2600),(bany - ((line * q) - p))
  146.   setdcode@ drilllegend!
  147.   add_flash@
  148.   axy@ (banx+2300),(bany - (line * q))      
  149. Next
  150. Back@
  151.  
  152. ;
  153. ; Draw last line and end the macro.
  154. ;
  155. 900
  156. Add_line@
  157. axy@ (banx),(bany - ((line * q) + 100))
  158. axy@ (banx + 2600),(bany - ((line * q) + 100))
  159. Add_line@
  160. axy@ (banx),(bany + 300)
  161. axy@ (banx),(bany - ((line * q) + 100))
  162. Add_line@
  163. axy@ (banx + 350),(bany + 100)
  164. axy@ (banx + 350),(bany - ((line * q) + 100))
  165. Add_line@
  166. axy@ (banx + 1350),(bany + 100)
  167. axy@ (banx + 1350),(bany - ((line * q) + 100))
  168. Add_line@
  169. axy@ (banx + 1900),(bany + 100)
  170. axy@ (banx + 1900),(bany - ((line * q) + 100))
  171. Add_line@
  172. axy@ (banx + 2600),(bany + 300)
  173. axy@ (banx + 2600),(bany - ((line * q) + 100))
  174. Find_dcode@
  175. setdcode@ tempdcode
  176. update_dcodebar@
  177. View_all@
  178. back@
  179. end
  180.  
  181. ;
  182. ; If there is no drill data, give a warning and end here.
  183. ;
  184. 999
  185. print "No drill layer! End Macro."
  186. end
  187.  
  188. 130
  189. Print "That was not a valid entry. Please try again."
  190. goto 400
  191.  
  192. 140
  193. Print "Please select a layer ofter than the drill layer."
  194. goto 400
  195.  
  196.