home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 December / PCWKCD1296.iso / demo / wgelectr / cameval / cam31 / misc.z / PANLSTAR.SCR < prev    next >
Text File  |  1995-12-04  |  6KB  |  261 lines

  1. ;Advanced CAM Technologies, Inc. Macro Version: 1.0
  2.  
  3. setdcode@ 10
  4. setlayer@ 0
  5. setsectorize@ 0,0
  6. textheight@ 100.0000
  7. textangle@ 0
  8. textmirror@ 0
  9. textjust@ 17
  10. textfitting@ 0
  11. textcspace@ 0.0000
  12. textlspace@ 0.0000
  13. textfont@ "SIMPLE.EFN"
  14. setfilmboxorigin@ 3
  15.  
  16. 100
  17. Ok_Cancel "This macro will panelize and construct a STAR vent pattern",OK
  18. If OK=0 then goto 900
  19. OK_Cancel "You must first have a 1-UP database loaded",OK
  20. If OK=0 then goto 900
  21.  
  22. ; Check to see if a Border layer exists
  23. Borderlayer=Borderlayer!
  24. If Borderlayer < 0 then goto 800
  25.  
  26. ; Get the panel parameters
  27. Input "Enter the Film X Size (inches): ", Filmx#
  28. If Filmx# < 1 then goto 830
  29. If Filmx# > 48 then goto 830
  30. Filmx# = Filmx# * 1000
  31. Input "Enter the Film Y Size (inches): ", Filmy#
  32. If Filmy# < 1 then goto 830
  33. If Filmy# > 48 then goto 830
  34. Filmy# = Filmy# * 1000
  35. Input "Enter the number of X copies: ", Xcopies
  36. If Xcopies < 1 then goto 830
  37. Input "Enter the number of Y copies: ", Ycopies
  38. If Ycopies < 1 then goto 830
  39. Input "Enter the X spacing between images (inches): ", IX#
  40. If IX# < 0.0 then goto 830
  41. If IX# > Filmx# then goto 830
  42. IX# = IX# * 1000
  43. Input "Enter the Y spacing between images (inches): ", IY#
  44. If IY# < 0.0 then goto 830
  45. If IY# > FilmY# then goto 830
  46. IY# = IY# * 1000
  47. Input "Enter the minimum border spacing allowed (inches): ",Minbrd#
  48. If Minbrd# < 0.0 then goto 830
  49. Minbdr# = Minbrd# * 1000
  50.  
  51. ; Test parameters for result
  52. Dbsizex# = Dbmaxx! - Dbminx!
  53. Dbsizey# = Dbmaxy! - Dbminy!
  54. If Dbsizex# > Filmx# then goto 810
  55. If Dbsizey# > Filmy# then goto 810
  56. If Filmx# < (Xcopies * (Dbsizex# + IX#)) + (2 * Minbdr#) then goto 820
  57. If Filmy# < (Ycopies * (Dbsizey# + IY#)) + (2 * Minbdr#) then goto 820
  58.  
  59. ; Go ahead and panelize
  60.  
  61. LLFX# = 0 - Filmx#/2
  62. LLFY# = 0 - Filmy#/2
  63. URFX# = 0 + Filmx#/2
  64. URFY# = 0 + Filmy#/2
  65. setfilmbox@ -12000.0000,10000.0000,12000.0000,-10000.0000
  66. panel_spread@ 0,0
  67. panel_spacing@ Minbdr#,Minbdr#,IX#,IY#,0
  68. panel_dimension@ Filmx#,Filmy#
  69. panel_outline@ 0,10,Borderlayer,0.0
  70. panel_copies@ Xcopies,Ycopies
  71. panel_mode@ 2
  72. panelization@
  73.  
  74. ; Now lets compute the "Knockout Area"
  75.  
  76. 200
  77. OK_Cancel "Do you want a STARBURST vent pattern? ",OK
  78. If OK = 0 then goto 900
  79. Input "Enter offset distance from image data (inches): ",Offset#
  80. If Offset# < 0.0 then goto 840
  81. Offset# = Offset# * 1000
  82. setlayer@ Borderlayer
  83. ; Remember the film coordinates
  84. Filmminx# = Dbminx!
  85. Filmminy# = Dbminy!
  86. Filmmaxx# = Dbmaxx!
  87. Filmmaxy# = Dbmaxy!
  88. setlayer@ Borderlayer
  89. ; Delete the film boundary for now
  90. edit_delete@
  91. axy@ Filmminx#,Filmminy#
  92. back@
  93. ; Draw the knockout polygon on the next available layer
  94. KOlayer = Blanklayer!
  95. setlayer@ KOlayer
  96. polylayer@ KOlayer
  97. polyfilldcode@ 10
  98. polyclearance@ 10.000
  99. polyfillpattern@ "SOLID"
  100. polyfillmethod@ "RASTER"
  101. polyaddtype@ "DRAWBORDER"
  102. ; Compute knock out coordinates
  103. P1X#=Dbminx!-Offset#
  104. P1Y#=Dbminy!-Offset#
  105. P2X#=Dbminx!-Offset#
  106. P2Y#=Dbmaxy!+Offset#
  107. P3X#=Dbmaxx!+Offset#
  108. P3Y#=Dbmaxy!+Offset#
  109. P4X#=Dbmaxx!+Offset#
  110. P4Y#=Dbminy!-Offset#
  111. add_pouring@
  112. axy@ P1X#,P1Y#
  113. axy@ P2X#,P2Y#
  114. axy@ P3X#,P3Y#
  115. axy@ P4X#,P4Y#
  116. back@
  117. back@
  118. end@
  119. ; Regenerate the film boundary
  120. setdcode@ 10
  121. setlayer@ Borderlayer
  122. add_rectangle@
  123. axy@ Filmminx#,Filmminy#
  124. axy@ Filmmaxx#,Filmmaxy#
  125. back@
  126. end@
  127. view_all@
  128.  
  129. ; Generate the StarBurst pattern
  130.  
  131. 300
  132. Input "Enter number of SPOKES per side (3-10): ",Spokes
  133. If Spokes < 3 then goto 850
  134. If Spokes > 10 then goto 850
  135. Spokes = Spokes + 1
  136. Incx# = (Filmmaxx# - Filmminx#) / (Spokes * 2)
  137. Incy# = (Filmmaxy# - Filmminy#) / (Spokes * 2)
  138. Spokes = Spokes -1
  139. Starlayer = Blanklayer!
  140. setsnap@ 0
  141. setlayer@ Starlayer
  142. polylayer@ Starlayer
  143. polyfilldcode@ 10
  144. polyclearance@ 20.0000
  145. polyfillpattern@ "SOLID"
  146. polyfillmethod@ "RASTER"
  147. polyaddtype@ "DRAWBORDER"
  148. add_pouring@
  149.  
  150. ; Draw spokes on TOP side
  151. axy@ 0.0000,0.0000
  152. axy@ Filmminx#,Filmmaxy#
  153. Lastx# = Filmminx# + Incx#/2
  154. Lasty# = Filmmaxy#
  155. axy@ Lastx#,Lasty#
  156. axy@ 0.0000,0.0000
  157. For Count = 1 to Spokes
  158. Lastx# = Lastx# + Incx#
  159. axy@ Lastx#,Lasty#
  160. Lastx# = Lastx# + Incx#
  161. axy@ Lastx#,Lasty#
  162. axy@ 0.0000,0.0000
  163. next
  164. axy@ Filmmaxx# - (Incx#/2),Lasty#
  165. axy@ Filmmaxx#,Filmmaxy#
  166.  
  167. ; Draw spokes on RIGHT side
  168. Lastx# = Filmmaxx#
  169. Lasty# = Filmmaxy# - Incy#/2
  170. axy@ Lastx#,Lasty#
  171. axy@ 0.0000,0.0000
  172. For Count = 1 to Spokes
  173. Lasty# = Lasty# - Incy#
  174. axy@ Lastx#,Lasty#
  175. Lasty# = Lasty# - Incy#
  176. axy@ Lastx#,Lasty#
  177. axy@ 0.0000,0.0000
  178. next
  179. axy@ Filmmaxx#,Filmminy# + (Incy#/2)
  180. axy@ Filmmaxx#,Filmminy#
  181.  
  182. ; Draw spokes on BOTTOM side
  183. Lastx# = Filmmaxx# - Incx#/2
  184. Lasty# = Filmminy#
  185. axy@ Lastx#,Lasty#
  186. axy@ 0.0000,0.0000
  187. For Count = 1 to Spokes
  188. Lastx# = Lastx# - Incx#
  189. axy@ Lastx#,Lasty#
  190. Lastx# = Lastx# - Incx#
  191. axy@ Lastx#,Lasty#
  192. axy@ 0.0000,0.0000
  193. next
  194. axy@ Filmminx# + (Incx#/2),Lasty#
  195. axy@ Filmminx#,Filmminy#
  196.  
  197. ; Draw spokes on LEFT side
  198. Lastx# = Filmminx#
  199. Lasty# = Filmminy# + Incy#/2
  200. axy@ Lastx#,Lasty#
  201. axy@ 0.0000,0.0000
  202. For Count = 1 to Spokes
  203. Lasty# = Lasty# + Incy#
  204. axy@ Lastx#,Lasty#
  205. Lasty# = Lasty# + Incy#
  206. axy@ Lastx#,Lasty#
  207. axy@ 0.0000,0.0000
  208. next
  209. axy@ Filmminx#,Filmmaxy# - (Incy#/2)
  210. axy@ Filmminx#,Filmmaxy#
  211. back@
  212. back@
  213. end@
  214.  
  215. 400
  216. ; Build the Composite
  217. Input "Enter the layer number to Vent: ",Desirelayer
  218. Desirelayer = Desirelayer - 1
  219. If Desirelayer < 0 then goto 860
  220. If Desirelayer > 31 then goto 860
  221. edit_compo_bkg@ 1,0
  222. edit_compo@ 0,0,Starlayer,1,"C1"
  223. edit_compo@ 0,1,KOlayer,-1,"C1"
  224. edit_compo@ 0,2,Desirelayer,1,"C1"
  225. view_composite@
  226. Print "Use Export/Composite and choose the 274X format"
  227. goto 900
  228.  
  229. ; Error messages
  230. 800
  231. Print "No BORDER layer exists"
  232. Print "Create a border and tag the layer accordingly"
  233. Goto 900
  234.  
  235. 810 
  236. Print "Film size is smaller than 1-up size"
  237. Goto 100
  238.  
  239. 820
  240. Print "Images will not fit. Check and reenter parameters"
  241. Goto 100
  242.  
  243. 830
  244. Print "Invalid Value"
  245. Goto 100
  246.  
  247. 840
  248. Print "Invalid Value"
  249. Goto 200
  250.  
  251. 850
  252. Print "Invalid Value"
  253. Goto 300
  254.  
  255. 860
  256. Print "Invalid Layer Number"
  257. Goto 400
  258.  
  259. 900
  260. End
  261.