home *** CD-ROM | disk | FTP | other *** search
- ;Advanced CAM Technologies, Inc. Macro Version: 1.0
-
- setdcode@ 10
- setlayer@ 0
- setsectorize@ 0,0
- textheight@ 100.0000
- textangle@ 0
- textmirror@ 0
- textjust@ 17
- textfitting@ 0
- textcspace@ 0.0000
- textlspace@ 0.0000
- textfont@ "SIMPLE.EFN"
- setfilmboxorigin@ 3
-
- 100
- Ok_Cancel "This macro will panelize and construct a STAR vent pattern",OK
- If OK=0 then goto 900
- OK_Cancel "You must first have a 1-UP database loaded",OK
- If OK=0 then goto 900
-
- ; Check to see if a Border layer exists
- Borderlayer=Borderlayer!
- If Borderlayer < 0 then goto 800
-
- ; Get the panel parameters
- Input "Enter the Film X Size (inches): ", Filmx#
- If Filmx# < 1 then goto 830
- If Filmx# > 48 then goto 830
- Filmx# = Filmx# * 1000
- Input "Enter the Film Y Size (inches): ", Filmy#
- If Filmy# < 1 then goto 830
- If Filmy# > 48 then goto 830
- Filmy# = Filmy# * 1000
- Input "Enter the number of X copies: ", Xcopies
- If Xcopies < 1 then goto 830
- Input "Enter the number of Y copies: ", Ycopies
- If Ycopies < 1 then goto 830
- Input "Enter the X spacing between images (inches): ", IX#
- If IX# < 0.0 then goto 830
- If IX# > Filmx# then goto 830
- IX# = IX# * 1000
- Input "Enter the Y spacing between images (inches): ", IY#
- If IY# < 0.0 then goto 830
- If IY# > FilmY# then goto 830
- IY# = IY# * 1000
- Input "Enter the minimum border spacing allowed (inches): ",Minbrd#
- If Minbrd# < 0.0 then goto 830
- Minbdr# = Minbrd# * 1000
-
- ; Test parameters for result
- Dbsizex# = Dbmaxx! - Dbminx!
- Dbsizey# = Dbmaxy! - Dbminy!
- If Dbsizex# > Filmx# then goto 810
- If Dbsizey# > Filmy# then goto 810
- If Filmx# < (Xcopies * (Dbsizex# + IX#)) + (2 * Minbdr#) then goto 820
- If Filmy# < (Ycopies * (Dbsizey# + IY#)) + (2 * Minbdr#) then goto 820
-
- ; Go ahead and panelize
-
- LLFX# = 0 - Filmx#/2
- LLFY# = 0 - Filmy#/2
- URFX# = 0 + Filmx#/2
- URFY# = 0 + Filmy#/2
- setfilmbox@ -12000.0000,10000.0000,12000.0000,-10000.0000
- panel_spread@ 0,0
- panel_spacing@ Minbdr#,Minbdr#,IX#,IY#,0
- panel_dimension@ Filmx#,Filmy#
- panel_outline@ 0,10,Borderlayer,0.0
- panel_copies@ Xcopies,Ycopies
- panel_mode@ 2
- panelization@
-
- ; Now lets compute the "Knockout Area"
-
- 200
- OK_Cancel "Do you want a STARBURST vent pattern? ",OK
- If OK = 0 then goto 900
- Input "Enter offset distance from image data (inches): ",Offset#
- If Offset# < 0.0 then goto 840
- Offset# = Offset# * 1000
- setlayer@ Borderlayer
- ; Remember the film coordinates
- Filmminx# = Dbminx!
- Filmminy# = Dbminy!
- Filmmaxx# = Dbmaxx!
- Filmmaxy# = Dbmaxy!
- setlayer@ Borderlayer
- ; Delete the film boundary for now
- edit_delete@
- axy@ Filmminx#,Filmminy#
- back@
- ; Draw the knockout polygon on the next available layer
- KOlayer = Blanklayer!
- setlayer@ KOlayer
- polylayer@ KOlayer
- polyfilldcode@ 10
- polyclearance@ 10.000
- polyfillpattern@ "SOLID"
- polyfillmethod@ "RASTER"
- polyaddtype@ "DRAWBORDER"
- ; Compute knock out coordinates
- P1X#=Dbminx!-Offset#
- P1Y#=Dbminy!-Offset#
- P2X#=Dbminx!-Offset#
- P2Y#=Dbmaxy!+Offset#
- P3X#=Dbmaxx!+Offset#
- P3Y#=Dbmaxy!+Offset#
- P4X#=Dbmaxx!+Offset#
- P4Y#=Dbminy!-Offset#
- add_pouring@
- axy@ P1X#,P1Y#
- axy@ P2X#,P2Y#
- axy@ P3X#,P3Y#
- axy@ P4X#,P4Y#
- back@
- back@
- end@
- ; Regenerate the film boundary
- setdcode@ 10
- setlayer@ Borderlayer
- add_rectangle@
- axy@ Filmminx#,Filmminy#
- axy@ Filmmaxx#,Filmmaxy#
- back@
- end@
- view_all@
-
- ; Generate the StarBurst pattern
-
- 300
- Input "Enter number of SPOKES per side (3-10): ",Spokes
- If Spokes < 3 then goto 850
- If Spokes > 10 then goto 850
- Spokes = Spokes + 1
- Incx# = (Filmmaxx# - Filmminx#) / (Spokes * 2)
- Incy# = (Filmmaxy# - Filmminy#) / (Spokes * 2)
- Spokes = Spokes -1
- Starlayer = Blanklayer!
- setsnap@ 0
- setlayer@ Starlayer
- polylayer@ Starlayer
- polyfilldcode@ 10
- polyclearance@ 20.0000
- polyfillpattern@ "SOLID"
- polyfillmethod@ "RASTER"
- polyaddtype@ "DRAWBORDER"
- add_pouring@
-
- ; Draw spokes on TOP side
- axy@ 0.0000,0.0000
- axy@ Filmminx#,Filmmaxy#
- Lastx# = Filmminx# + Incx#/2
- Lasty# = Filmmaxy#
- axy@ Lastx#,Lasty#
- axy@ 0.0000,0.0000
- For Count = 1 to Spokes
- Lastx# = Lastx# + Incx#
- axy@ Lastx#,Lasty#
- Lastx# = Lastx# + Incx#
- axy@ Lastx#,Lasty#
- axy@ 0.0000,0.0000
- next
- axy@ Filmmaxx# - (Incx#/2),Lasty#
- axy@ Filmmaxx#,Filmmaxy#
-
- ; Draw spokes on RIGHT side
- Lastx# = Filmmaxx#
- Lasty# = Filmmaxy# - Incy#/2
- axy@ Lastx#,Lasty#
- axy@ 0.0000,0.0000
- For Count = 1 to Spokes
- Lasty# = Lasty# - Incy#
- axy@ Lastx#,Lasty#
- Lasty# = Lasty# - Incy#
- axy@ Lastx#,Lasty#
- axy@ 0.0000,0.0000
- next
- axy@ Filmmaxx#,Filmminy# + (Incy#/2)
- axy@ Filmmaxx#,Filmminy#
-
- ; Draw spokes on BOTTOM side
- Lastx# = Filmmaxx# - Incx#/2
- Lasty# = Filmminy#
- axy@ Lastx#,Lasty#
- axy@ 0.0000,0.0000
- For Count = 1 to Spokes
- Lastx# = Lastx# - Incx#
- axy@ Lastx#,Lasty#
- Lastx# = Lastx# - Incx#
- axy@ Lastx#,Lasty#
- axy@ 0.0000,0.0000
- next
- axy@ Filmminx# + (Incx#/2),Lasty#
- axy@ Filmminx#,Filmminy#
-
- ; Draw spokes on LEFT side
- Lastx# = Filmminx#
- Lasty# = Filmminy# + Incy#/2
- axy@ Lastx#,Lasty#
- axy@ 0.0000,0.0000
- For Count = 1 to Spokes
- Lasty# = Lasty# + Incy#
- axy@ Lastx#,Lasty#
- Lasty# = Lasty# + Incy#
- axy@ Lastx#,Lasty#
- axy@ 0.0000,0.0000
- next
- axy@ Filmminx#,Filmmaxy# - (Incy#/2)
- axy@ Filmminx#,Filmmaxy#
- back@
- back@
- end@
-
- 400
- ; Build the Composite
- Input "Enter the layer number to Vent: ",Desirelayer
- Desirelayer = Desirelayer - 1
- If Desirelayer < 0 then goto 860
- If Desirelayer > 31 then goto 860
- edit_compo_bkg@ 1,0
- edit_compo@ 0,0,Starlayer,1,"C1"
- edit_compo@ 0,1,KOlayer,-1,"C1"
- edit_compo@ 0,2,Desirelayer,1,"C1"
- view_composite@
- Print "Use Export/Composite and choose the 274X format"
- goto 900
-
- ; Error messages
- 800
- Print "No BORDER layer exists"
- Print "Create a border and tag the layer accordingly"
- Goto 900
-
- 810
- Print "Film size is smaller than 1-up size"
- Goto 100
-
- 820
- Print "Images will not fit. Check and reenter parameters"
- Goto 100
-
- 830
- Print "Invalid Value"
- Goto 100
-
- 840
- Print "Invalid Value"
- Goto 200
-
- 850
- Print "Invalid Value"
- Goto 300
-
- 860
- Print "Invalid Layer Number"
- Goto 400
-
- 900
- End
-