📄 border1.scr
字号:
if layertype!=0 or layertype!=3 or isglyr%>0 then
frmyes%=1
canceled%=0
else
frmyes%=0
canceled%=0
end if
else
OpenForm #1,40,8, "制作板框", character, YESNOCANCEL
AddForm #1, 0, 0, "当前层是: "+layername!,Print
AddForm #1, 0, 2, "增加板框吗?", print
AddForm #1, 2, 4, "1.按Yes 增加板框", print
AddForm #1, 2, 5, "2.按No不增加板框", print
AddForm #1, 2, 6, "3.按Cancel结束宏", print
DisplayForm #1
canceled% = formCancel(1)
frmyes%=formyes(1)
DeleteForm #1
end if
if canceled% then
setlayer@ layertmp%
layer_alloff@ 1
edit_move@
setbydcode@ ""
edit_selectall2@
movetolayer@ lay%
end@
goto 900
end if
if frmyes then
if isglyr%<0 then
coppercount%=coppercount%+1
copperlyr%(coppercount%)=lay%
layer_alloff@ 1
edit_copy@
setbydcode@ ""
edit_group@
edit_inside@
setcopies@ 1
setsnap@ 0 '关闭Z捕捉#
setgridsnap@ 0
axy@ minx#-widx#-0.2,maxy#+widy#+0.2
axy@ minx#,miny#-widy#-0.2
axy@ minx#-widx#-0.2,miny#
axy@ maxx#+widx#+0.2,miny#-widy#-0.2
axy@ maxx#,maxy#+widy#+0.2
axy@ maxx#+widx#+0.2,miny#-widy#-0.2
axy@ minx#-widx#-0.2,maxy#+widy#+0.2
axy@ maxx#+widx#+0.2,maxy#
setcoplayer@ layertmp%,1
copy_to_layer@
editflag%=1
end if
editcount%=editcount%+1
editlayer%(editcount%)=lay%
'尾孔
setlayer@ layertmp%
tadd%=0
select case lhalg%
case 1
if isglyr%<0 then
varx#=maxx#-(maxx#-minx#)*lastholemir%+lastx#
vary#=miny#-ldist#+lasty#
for t=maxid% to counter%
if toolsize#(t)<>holesize# or (flagsame%=1 and flagused%=1) then
tadd%=tadd%+1
' filt$=filt$+","+rtrim$(str$(dcodeadd%(t)))
setdcode@ dcodeadd%(t)
update_dcodebar@
add_flash@
axy@ varx#-(tadd%-1)*(1-2*lastholemir%)*lhsize#,vary#
back@
end if
next
end if
if gcount%>0 then
setdcode@ tdcode%
update_dcodebar@
add_rectangle@
axy@ maxx#+widint#,maxy#
axy@ maxx#+widint#+2,maxy#-(gcount%+2)*thigh#
back@
end if
case 2
if isglyr%<0 then
varx#=maxx#+ldist#+lastx#
vary#=maxy#-(maxy#-miny#)*lastholemir%+lasty#
for t=maxid% to counter%
if toolsize#(t)<>holesize# or (flagsame%=1 and flagused%=1) then
tadd%=tadd%+1
' filt$=filt$+","+rtrim$(str$(dcodeadd%(t)))
setdcode@ dcodeadd%(t)
update_dcodebar@
add_flash@
axy@ varx#,vary#-(tadd%-1)*(1-2*lastholemir%)*lhsize#
back@
end if
next
end if
if gcount%>0 then
setdcode@ tdcode%
update_dcodebar@
add_rectangle@
axy@ minx#,maxy#+widint#
axy@ minx#+(gcount%+2)*thigh#,maxy#+widint#+2
back@
end if
case 3
if isglyr%<0 then
varx#=minx#+(maxx#-minx#)*lastholemir%+lastx#
vary#=maxy#+ldist#+lasty#
for t=maxid% to counter%
if toolsize#(t)<>holesize# or (flagsame%=1 and flagused%=1) then
tadd%=tadd%+1
' filt$=filt$+","+rtrim$(str$(dcodeadd%(t)))
setdcode@ dcodeadd%(t)
update_dcodebar@
add_flash@
axy@ varx#+(tadd%-1)*(1-2*lastholemir%)*lhsize#,vary#
back@
end if
next
end if
if gcount%>0 then
setdcode@ tdcode%
update_dcodebar@
add_rectangle@
axy@ minx#-2-widint#,miny#
axy@ minx#-widint#,miny#+(gcount%+2)*thigh#
back@
end if
end select
'耙孔
if isglyr%>0 then
setdcode@ aimdcode%
update_dcodebar@
select case lhalg%
case 1
add_flash@
axy@ minx#,miny#-aimplace#
axy@ maxx#,maxy#+aimplace#
axy@ minx#,maxy#+aimplace#
back@
case 2
add_flash@
axy@ maxx#+aimplace#,miny#
axy@ minx#-aimplace#,miny#
axy@ minx#-aimplace#,maxy#
back@
case 3
add_flash@
axy@ maxx#,maxy#+aimplace#
axy@ maxx#,miny#-aimplace#
axy@ minx#,miny#-aimplace#
back@
end select
end if
'加外围孔
if isglyr%<0 then
hdcodetmp%=hdcode2%
varx#=(maxx#+minx#)/2+holelocx#
vary#=miny#-holedist#+horizy#
setdcode@ hdcodetmp%
update_dcodebar@
add_flash@
axy@ varx#,vary#
back@
varx#=(maxx#+minx#)/2+holelocx#
vary#=maxy#+holedist#-horizy#
setdcode@ hdcodetmp%
update_dcodebar@
add_flash@
axy@ varx#,vary#
back@
vary#=(maxy#+miny#)/2+holelocy#
varx#=minx#-holedist#-vertx#
setdcode@ hdcodetmp%
update_dcodebar@
add_flash@
axy@ varx#,vary#
back@
vary#=(maxy#+miny#)/2+holelocy#
varx#=maxx#+holedist#+vertx#
setdcode@ hdcodetmp%
update_dcodebar@
add_flash@
axy@ varx#,vary#
back@
setdcode@ ldcode%
update_dcodebar@
add_rectangle@
axy@ minx#-widint#+0.2,miny#-widint#+0.2
axy@ maxx#+widint#-0.2,maxy#+widint#-0.2
back@
polylayer@ layertmp%
polyfilldcode@ pdcode%
polyclearance@ 0.2
polyfillpattern@ "SOLID"
polyfillmethod@ "VECTOR"
polyaddtype@ "DRAWBORDER"
polydeleteislands@ "Yes"
add_pouring@
axy@ minx#-widx#-0.2,maxy#+widy#+0.2
axy@ minx#-widx#-0.2,miny#-widy#-0.2
axy@ maxx#+widx#+0.2,miny#-widy#-0.2
axy@ maxx#+widx#+0.2,maxy#+widy#+0.2
back@
end@
setsnap@ 0 '关闭Z捕捉#
setgridsnap@ 0
edit_delete@
axy@ minx#-widint#+0.2,miny#-widint#+0.2
end@
setlayer@ layertmp%
layer_alloff@ 1
edit_move@
if gcount%>0 then
setbydcode@ rtrim$(str$(pdcode%))+","+rtrim$(str$(tdcode%))
else
setbydcode@ rtrim$(str$(pdcode%))
end if
edit_selectall2@
movetolayer@ lay%
end@
layer_alloff@ 1
edit_delete@
setbydcode@ ""
edit_selectall2@
delete_edits@ 4, 1
end@
end if
end if
frmyes%=0
setlayer@ lay%
layer_alloff@ 1
view_all@
if autoboard%=1 or isglyr%>0 then
if layertype!=0 then
latmp$=""
lasel%=1
hdcodesel%=1
tmir%=0
frmyes%=1
end if
if layertype!=3 then
latmp$=""
lasel%=4
hdcodesel%=1
tmir%=1
frmyes%=1
end if
if layertype!=6 then
latmp$=""
lasel%=7
hdcodesel%=2
tmir%=0
frmyes%=1
end if
if layertype!=7 then
latmp$=""
lasel%=3
hdcodesel%=2
tmir%=0
frmyes%=1
end if
if layertype!=8 then
latmp$=""
lasel%=6
hdcodesel%=2
tmir%=1
frmyes%=1
end if
if layertype!=11 then
latmp$=""
lasel%=2
hdcodesel%=2
tmir%=0
frmyes%=1
end if
if layertype!=12 then
latmp$=""
lasel%=5
hdcodesel%=2
tmir%=1
frmyes%=1
end if
if layertype!<>0 and layertype!<>3 and layertype!<>6 and layertype!<>7 and layertype!<>8 and layertype!<>11 and layertype!<>12 then
frmyes%=0
end if
if ucase$(mid$(layername!,len(layername!)-2))="GTB" then
latmp$="GTB"
lasel%=1
hdcodesel%=2
tmir%=0
frmyes%=1
end if
if ucase$(mid$(layername!,len(layername!)-2))="GBB" then
latmp$="GBB"
lasel%=1
hdcodesel%=2
tmir%=1
frmyes%=1
end if
if isglyr%>0 then
latmp$=gname$(isglyr%)
lasel%=1
' hdcodesel%=2
tmir%=gmir%(isglyr%)
frmyes%=1
end if
else
latmp$=""
OpenForm #1,70,13, "增加文字", character, YESNOCANCEL
AddForm #1, 0, 0, "当前层是: "+layername!,Print
AddForm #1, 0, 1, "生产编号: "+ucase$(pcbname$),Print
AddForm #1, 0, 11, "增加文字吗?", print
AddForm #1, 2, 12, "1.按Yes 增加文字", print
AddForm #1, 22, 12, "2.按No不增加文字", print
AddForm #1, 42, 12, "3.按Cancel结束", print
AddForm #1, 0, 2, "文字1:", input,tstr1$
AddForm #1, 0, 3, "文字2:", input,tstr2$
AddForm #1, 0, 4, "文字3:", input,tstr3$
addform #1, 0, 10, "字符高度:",input,thigh#
addform #1, 36, 10, "文字D 码:",input,tsize#
AddForm #1, 36, 11, "镜像文字", check,tmir%
AddForm #1, 40, 0, "输入层名称:GTB-顶层蓝胶",print
AddForm #1, 54, 1, "GBB-底层蓝胶",print
AddForm #1, 42, 2, "", input,latmp$
addform #1, 0, 6, "选择尾孔大小(mm):",choice,hdcodesel%,"外径:"+mid$(str$(holesize#+lwid#*4),1,4)+" 内径:"+mid$(str$(holesize#+lwid#*2),1,4),"外径:"+mid$(str$(holesize#+lwid#*8),1,4)+" 内径:"+mid$(str$(holesize#+lwid#*6),1,4),"外径:"+mid$(str$(holesize#+lwid#*12),1,4)+" 内径:"+mid$(str$(holesize#+lwid#*10),1,4)
AddForm #1, 42, 3, "或者:",print
AddForm #1, 20, 5, "文字2 ", check,tl1%
AddForm #1, 0, 5, "文字连接: 文字1", print
AddForm #1, 32, 5, "文字3 ", check,tl2%
AddForm #1, 50, 3, "选择层:", choice,lasel%,"GTL","GTS","GTO","GBL","GBS","GBO","GKO"
DisplayForm #1
canceled% = formCancel(1)
frmyes%=formyes(1)
DeleteForm #1
if canceled% then
goto 900
end if
end if
if frmyes% then
'根据层属性决定外围孔及字符镜像
select case ltrim$(rtrim$(ucase$(latmp$)))
case "GTB"
hdcodesel%=2
bluecount%=bluecount%+1
bluelyr%(bluecount%)=lay%
bluemir%(bluecount%)=0
tmir%=0
edit_layer@ lay%,-2,-2,4,-2,""
case "GBB"
hdcodesel%=2
bluecount%=bluecount%+1
bluelyr%(bluecount%)=lay%
bluemir%(bluecount%)=1
tmir%=1
edit_layer@ lay%,-2,-2,4,-2,""
case ""
select case lasel%
case 1
hdcodesel%=1
tmir%=0
edit_layer@ lay%,-2,-2,0,-2,""
case 2
hdcodesel%=2
tmir%=0
maskcount%=maskcount%+1
masklyr%(maskcount%)=lay%
maskmir%(maskcount%)=tmir%
edit_layer@ lay%,-2,-2,11,-2,""
case 3
hdcodesel%=2
tmir%=0
silkcount%=silkcount%+1
silklyr%(silkcount%)=lay%
silkmir%(silkcount%)=tmir%
edit_layer@ lay%,-2,-2,7,-2,""
case 4
hdcodesel%=1
tmir%=1
edit_layer@ lay%,-2,-2,3,-2,""
case 5
hdcodesel%=2
tmir%=1
maskcount%=maskcount%+1
masklyr%(maskcount%)=lay%
maskmir%(maskcount%)=tmir%
edit_layer@ lay%,-2,-2,12,-2,""
case 6
hdcodesel%=2
tmir%=1
silkcount%=silkcount%+1
silklyr%(silkcount%)=lay%
silkmir%(silkcount%)=tmir%
edit_layer@ lay%,-2,-2,8,-2,""
case 7
hdcodesel%=2
tmir%=0
borderlyr%=lay%
edit_layer@ lay%,-2,-2,6,-2,""
borderclearlyr%=blanklayer!
edit_layer@ borderclearlyr%,-2,-2,4,0,"GKO_Clear"
layer_alloff@ 1
edit_copy@
setcopies@ 1
seteditflash@ 0
edit_selectall2@
setcoplayer@ borderclearlyr%,1
copy_to_layer@
if ginvertflag%>0 then
gclearlyr%=blanklayer!
edit_layer@ gclearlyr%,-2,-2,4,0,"INV_Clear"
setlayer@ lay%
layer_alloff@ 1
edit_copy@
setcopies@ 1
seteditflash@ 0
edit_selectall2@
setcoplayer@ gclearlyr%,1
copy_to_layer@
setsnap@ 0 '关闭Z捕捉#
setgridsnap@ 0
setlayer@ gclearlyr%
polylayer@ gclearlyr%
polyfilldcode@ pdcode%
polyclearance@ 0
polyfillpattern@ "SOLID"
polyfillmethod@ "VECTOR"
polyaddtype@ "DRAWBORDER"
polyfilltoborder@ "Yes"
polydeleteislands@ "Yes"
add_pouring@
setsnap@ 0 '关闭Z捕捉#
setgridsnap@ 0
axy@ minx#-1,maxy#+1
axy@ minx#-1,miny#-1
axy@ maxx#+1,miny#-1
axy@ maxx#+1,maxy#+1
back@
end@
end if
setlayer@ lay%
end select
end select
'尾孔
if isglyr%>0 then
setlayer@ layertmp%
else
setlayer@ lay%
end if
tadd%=0
select case lhalg%
case 1
varx#=maxx#-(maxx#-minx#)*lastholemir%+lastx#
vary#=miny#-ldist#+lasty#
for t=maxid% to counter%
if toolsize#(t)<>holesize# or (flagsame%=1 and flagused%=1) then
tadd%=tadd%+1
' filt$=filt$+","+rtrim$(str$(dcodeadd%(t)))
setdcode@ dcodeadd%(t)
update_dcodebar@
add_flash@
axy@ varx#-(tadd%-1)*(1-2*lastholemir%)*lhsize#,vary#
back@
end if
next
case 2
varx#=maxx#+ldist#+lastx#
vary#=maxy#-(maxy#-miny#)*lastholemir%+lasty#
for t=maxid% to counter%
if toolsize#(t)<>holesize# or (flagsame%=1 and flagused%=1) then
tadd%=tadd%+1
' filt$=filt$+","+rtrim$(str$(dcodeadd%(t)))
setdcode@ dcodeadd%(t)
update_dcodebar@
add_flash@
axy@ varx#,vary#-(tadd%-1)*(1-2*lastholemir%)*lhsize#
back@
end if
next
case 3
varx#=minx#+(maxx#-minx#)*lastholemir%+lastx#
vary#=maxy#+ldist#+lasty#
for t=maxid% to counter%
if toolsize#(t)<>holesize# or (flagsame%=1 and flagused%=1) then
tadd%=tadd%+1
' filt$=filt$+","+rtrim$(str$(dcodeadd%(t)))
setdcode@ dcodeadd%(t)
update_dcodebar@
add_flash@
axy@ varx#+(tadd%-1)*(1-2*lastholemir%)*lhsize#,vary#
back@
end if
next
end select
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -