home *** CD-ROM | disk | FTP | other *** search
- ; Tool Chart Script
- ; Gordon W. Widera
- ; 13 / June / 1994
-
- ;
- ; If there is no drill layer, quit the program.
- ;
- If drilllayer! < 0 then goto 999
-
- ;
- ; Create a dcode to draw with.
- ;
- tempdcode = blankdcode!
- Edit_aperture@ tempdcode,1,5,5,tempdcode,""
-
- ;
- ; Define text.
- ;
- Textheight@ 75.0000
- Textangle@ 0
- Textcspace@ 20.0000
- Textlspace@ 100.0000
- Textmirror@ 0
- Textfitting@ 0
- Textjust@ 5
-
- ;
- ; Declair variables
- ;
- a = 0
- p = 100
- q = 200
- line = 0
- bar = 0
- layer = 0
- tool = 0
- banx = 0
- bany = 0
- space1$ = " "
- space4$ = " "
-
- ;
- ; Save the database extent.
- ;
- minx = dbminx!
- maxx = dbmaxx!
- miny = dbminy!
- maxy = dbmaxy!
-
- ;
- ; Count up the number of drill tools.
- ;
- For a = 1 to 99
- set_drill_tool@ a
- If drillsize! = 0 then goto 400
- tool = tool + 1
- next
-
- ;
- ; Set the active layer.
- ;
- 400
- Setlayer@ blanklayer!, "Chart.gbr"
- ;Setlyaer@ activelayer!, "Chart.gbr"
- ;edit_layer blanklayer!,11,11,0,0,"Chart.gbr"
- update_layerbar@
-
- ;
- ; Set the distance from the board border.
- ;
- Input "Enter an offset from the board border (mills).", offset
-
- ;
- ; Set tool chart placement.
- ;
- 200
- Input "Place Tool Chart, Left/Right or Top/Bottom.", side$
- If side$ = "L" then goto 100
- If side$ = "l" then goto 100
- If side$ = "R" then goto 110
- If side$ = "r" then goto 110
- If side$ = "T" then goto 150
- If side$ = "t" then goto 150
- If side$ = "B" then goto 160
- If side$ = "b" then goto 160
- Print "That was not a valid entry. Please try again."
- goto 200
-
- 110
- maxy = dbmaxy!
- banx = (maxx + offset)
- bany = ((maxy + (tool * 100)) / 2)
- goto 300
-
- 100
- maxy = dbmaxy!
- banx = ((minx - 2600) - offset)
- bany = ((maxy + (tool * 100)) / 2)
- goto 300
-
- 150
- banx = ((maxx / 2) - 1300)
- bany = (maxy + (((tool * q) + 100) + offset))
- goto 300
-
- 160
- banx = ((maxx / 2) - 1300)
- bany = ((miny - 300) - offset)
-
- ;
- ; Draw tool chart header.
- ;
- 300
- Setdcode@ tempdcode
- Add_line@
- axy@ (banx),(bany + 300)
- axy@ (banx + 2600),(bany + 300)
- Setdcode@ tempdcode
- Add_text@
- Addtext@ banx,(bany + 200),0,0, " Tool Chart "
- Add_line@
- axy@ (banx),(bany + 100)
- axy@ (banx + 2600),(bany + 100)
- Back@
- Setdcode@ tempdcode
- Add_text@
- Addtext@ banx,(bany),0,0, " No. Size(mils) Count Legend"
- Back@
-
- ;
- ; Draw tool information.
- ;
- For n = 1 to 99
- setdcode@ tempdcode
- set_drill_tool@ n
- If drilllegend! = 0 then goto 900
- line = line + 1
- x$ = n
- y$ = drillsize!
- z$ = drillcount!
- out$ = space1$ + x$ + space4$ + y$ + space4$ + z$
- addtext@ (banx),(bany - (line * q)),0,0, out$
- Add_line@
- axy@ (banx),(bany - ((line * q) - p))
- axy@ (banx + 2600),(bany - ((line * q) - p))
- setdcode@ drilllegend!
- add_flash@
- axy@ (banx+2300),(bany - (line * q))
- Next
- Back@
-
- ;
- ; Draw last line and end the macro.
- ;
- 900
- Add_line@
- axy@ (banx),(bany - ((line * q) + 100))
- axy@ (banx + 2600),(bany - ((line * q) + 100))
- Add_line@
- axy@ (banx),(bany + 300)
- axy@ (banx),(bany - ((line * q) + 100))
- Add_line@
- axy@ (banx + 350),(bany + 100)
- axy@ (banx + 350),(bany - ((line * q) + 100))
- Add_line@
- axy@ (banx + 1350),(bany + 100)
- axy@ (banx + 1350),(bany - ((line * q) + 100))
- Add_line@
- axy@ (banx + 1900),(bany + 100)
- axy@ (banx + 1900),(bany - ((line * q) + 100))
- Add_line@
- axy@ (banx + 2600),(bany + 300)
- axy@ (banx + 2600),(bany - ((line * q) + 100))
- Find_dcode@
- setdcode@ tempdcode
- update_dcodebar@
- View_all@
- back@
- end
-
- ;
- ; If there is no drill data, give a warning and end here.
- ;
- 999
- print "No drill layer! End Macro."
- end
-
- 130
- Print "That was not a valid entry. Please try again."
- goto 400
-
- 140
- Print "Please select a layer ofter than the drill layer."
- goto 400
-
-