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 >
Wrap
Text File
|
1995-07-13
|
4KB
|
165 lines
; Automatic Panelization Script
; Version 2.2
; Date: 7/13/95
view_toolbar@
; are you using camware.
ok_cancel "Are you running CAMWare?", cware
if cware = 0 then goto 5
print_msg "Macro exiting -- Cannot run in CAMWare mode..."
delay 1500
end
5
; if there is no drill layer, quit the program.
if drilllayer! = -1 then goto 900
; Find the TOP layer
print_msg "Finding the TOP layer -- Please wait..."
toplayer = 0
for a = 0 to 32
setlayer@ a
if layertype! > 0 then goto 10
toplayer = a
a = 32
10 next
; Subroutine 100 computes the min dcode used in draws.
print_msg "Find the smallest dcode used in draws..."
gosub 100
; Subroutine 200 computes the min dcode used in flashes.
print_msg "Find the smallest dcode used in flashes..."
gosub 200
; Do a panelization according to the filmsize.
print_msg "Panelizing", dbname!
panel_spread@ 0,0
panel_spacing@ 1000,1000,500,500,0
panel_dimension@ filmmaxx!-filmminx!,filmmaxy!-filmminy!
autogen = 0
blayer = borderlayer!
if blayer = -1 then autogen = 1
if blayer = -1 then blayer = blanklayer!
tempdcode = blankdcode!
edit_aperture@ tempdcode,1,5,5,tempdcode
panel_outline@ autogen,tempdcode,blayer,0.0
panelization@
; Save the database extent.
minx = dbminx!
maxx = dbmaxx!
miny = dbminy!
maxy = dbmaxy!
; Draw test coupon at appr. lower center of the panel.
setdcode@ tempdcode
setlayer@ borderlayer!
boxstartx = (minx+maxx)/2 - 500;
boxstarty = miny + 500;
add_rectangle@
axy@ boxstartx,boxstarty
axy@ boxstartx+1000,boxstarty+500
back@
; Draw 4 lines.
setdcode@ drawdcode
setlayer@ toplayer
add_line@
for i = 1 to 4
newy = boxstarty + (i*100)
axy@ boxstartx+100, newy
axy@ boxstartx+800, newy
back@
next
back@
; Draw 4 flashes.
setdcode@ flashdcode
add_flash@
for i = 1 to 4
newy = boxstarty + (i*100)
axy@ boxstartx+900, newy
next
back@
; Draw drill coupons at upper left and lower right of panel.
setdcode@ tempdcode
setlayer@ borderlayer!
ulboxstartx = minx + 500;
ulboxstarty = maxy - 500;
lrboxstartx = maxx - 3000;
lrboxstarty = miny + 500;
add_rectangle@
axy@ ulboxstartx,ulboxstarty
axy@ ulboxstartx+2500,ulboxstarty-500
axy@ lrboxstartx,lrboxstarty
axy@ lrboxstartx+2500,lrboxstarty+500
back@
; Draw first 10 drill legend.
setlayer@ drilllayer!
print_msg "Draw first 10 drill legend..."
for i = 1 to 10
set_drill_tool@ i
if drilllegend! = 0 then goto 1000
ulnewx = ulboxstartx + (i*250)
lrnewx = lrboxstartx + (i*250)
set_adddrill@ i
util_drill_addhit@
axy@ ulnewx,(ulboxstarty-250)
util_drill_addhit@
axy@ lrnewx,(lrboxstarty+250)
back@
next
back@
; Zoom home and quit.
1000
view_all@
print_msg "Drill Sort..."
drill_sort_set@ 0,tempdcode,50, drilllayer!
drill_sort@ 0,0,0,0
print_msg "Zoom Home..."
close_msg
view_toolbar@
end
; If there is no drill data, give a warning and end here.
900
view_toolbar@
print "No drill layer! Macro Exits."
end
; This subroutine goes through the whole aperture table and
; computes the minimum dcode used to in draws.
100
drawdcode = 10;
size = 1000
for i = 10 to highestdcode!
setdcode@ i
if dcodeshape! = 0 then goto 101
if dcodesizex! > size then goto 101
if numdraws! = 0 then goto 101
size = dcodesizex!
drawdcode = i
101 next
return
; This subroutine goes through the whole aperture table and
; computes the minimum dcode used to in flashes.
200
flashdcode = 10;
size = 1000
for i = 10 to highestdcode!
setdcode@ i
if dcodeshape! = 0 then goto 201
if dcodesizex! > size then goto 201
if numflashes! = 0 then goto 201
size = dcodesizex!
flashdcode = i
201 next
return