|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
; load("Quick_PadCreate.il")
axlCmdRegister("quick_padcreate" 'quick_padcrt)
defun(quick_padcrt ()
let( (judgeflag curdsnunit)
;----------------------帮助文件----------------------
if(isFile("pad_create_help.log")
then
printf("help file exist!\n")
else
helpfile = "./pad_create_help.log"
helpoutport = outfile(helpfile "w")
fprintf(helpoutport "//////////////////////////////////////////////////////////////////// \n\n")
fprintf(helpoutport " ___ ___ ___ \n")
fprintf(helpoutport " /\\ \\ /\\__\\ /\\ \\ \n")
fprintf(helpoutport " \\:\\ \\ /:/ _/_ /::\\ \\ \n")
fprintf(helpoutport " \\:\\ \\ /:/ /\\__\\ /:/\\:\\__\\ \n")
fprintf(helpoutport " ___ /::\\ \\ /:/ /:/ _/_ ___ ___ /:/ /:/ / \n")
fprintf(helpoutport " /\\ /:/\\:\\__\\ /:/_/:/ /\\__\\ /\\ \\ /\\__\\ /:/_/:/ / \n")
fprintf(helpoutport " \\:\\/:/ \\/__/ \\:\\/:/ /:/ / \\:\\ \\ /:/ / \\:\\/:/ / \n")
fprintf(helpoutport " \\::/__/ \\::/_/:/ / \\:\\ /:/ / \\::/__/ \n")
fprintf(helpoutport " \\:\\ \\ \\:\\/:/ / \\:\\/:/ / \\:\\ \\ \n")
fprintf(helpoutport " \\:\\__\\ \\::/ / \\::/ / \\:\\__\\ \n")
fprintf(helpoutport " \\/__/ \\/__/ \\/__/ \\/__/ \n\n")
fprintf(helpoutport "//////////////////////////////////////////////////////////////////// \n")
fprintf(helpoutport "\n\n")
fprintf(helpoutport "\271\246\304\334\313\265\303\367\243\272\n")
fprintf(helpoutport "\261\276\271\246\304\334\277\311\322\324\323\303\300\264\264\264\275\250\270\367\326\326\320\316\327\264\265\304\272\270\305\314\243\254\326\247\263\326\305\372\301\277\262\331\327\367\241\243\n\n")
fprintf(helpoutport "\300\340\320\315\313\265\303\367\243\272\n")
fprintf(helpoutport "1,SMDR:\326\270\261\355\314\371\263\244/\325\375\267\275\320\316\272\270\305\314\243\254\327\350\272\270\261\310\305\314\314\345\264\3630.1mm\241\243\n")
fprintf(helpoutport "2,SMDC:\261\355\314\371\324\262\320\316\272\270\305\314\243\254\327\350\272\270\261\310\305\314\314\345\264\3630.1mm\241\243\n")
fprintf(helpoutport "3,PTHC:\315\250\277\327\324\262\320\316\272\270\305\314\243\254\315\254\312\261\273\341\264\264\275\250\261\355\262\343\316\252\325\375\267\275\320\316\265\304\315\254\263\337\264\347\272\270\305\314\243\254\260\374\272\254FLASH\241\243\n")
fprintf(helpoutport "4,NPTHC:\315\250\277\327\267\307\275\360\312\364\273\257\324\262\320\316\272\270\305\314\241\243\n")
fprintf(helpoutport "5,VIAC:\324\262\320\316\271\375\277\327\243\254\303\273\323\320\327\350\272\270\241\243\n\n")
fprintf(helpoutport "\271\246\304\334\313\265\303\367\243\272\n")
fprintf(helpoutport "1,\264\264\275\250\243\272\273\371\323\332\265\261\307\260\262\316\312\375\243\254\264\264\275\250\266\324\323\246\265\245\270\366\273\362\266\340\270\366\272\270\305\314\241\243\n")
fprintf(helpoutport "2,\263\365\312\274\326\265\243\272\262\316\312\375\263\365\312\274\273\257\241\243\n")
fprintf(helpoutport "3,\315\313\263\366\243\272\315\313\263\366\265\261\307\260\263\314\320\362\241\243\n\n")
fprintf(helpoutport "\262\316\312\375\313\265\303\367\243\272\n")
fprintf(helpoutport "1,xx_bgn:\272\270\305\314\306\360\312\274\263\337\264\347\241\243\n")
fprintf(helpoutport "2,xx_end:\326\325\326\271\263\337\264\347\243\254\261\330\320\353\264\363\323\332\265\310\323\332\306\360\312\274\263\337\264\347\241\243\n")
fprintf(helpoutport "3,incx:\265\335\324\366\263\337\264\347\241\243\n")
close(helpoutport)
)
;----------------------功能函数----------------------------
judgeflag = and(axlDBGetDesign()->symbols axlDBGetDesign()->nets) ;当前PCB是否是没有有器件+网络的空板
curdsnunit = axlGetParam("paramDesign")->units
if( (!judgeflag)
then
if((curdsnunit == "millimeters" )
then
; printf("Current unit is millimeters! Progressing!\n")
printf("\273\267\276\263\325\375\310\267\243\254\277\311\322\324\275\370\320\320\262\331\327\367\241\243\n")
quick_padcrt_form()
else
axlDBChangeDesignUnits("millimeters" 3)
; printf("Allready Changed the unit to millimeters.continue Progressing!\n")
printf("\265\245\316\273\262\273\312\307\300\345\303\327\243\254\322\321\320\336\270\304\n")
quick_padcrt_form()
)
else
if( (curdsnunit == "millimeters")
then
; printf("Design is not empty .but unit = cm ! progressing!\n")
printf("\267\307\277\325\271\244\263\314\243\254\265\245\316\273\325\375\310\267\243\254\277\311\322\324\275\370\320\320\262\331\327\367\241\243\n")
quick_padcrt_form()
else
printf("\265\261\307\260\311\350\274\306\260\374\272\254\315\370\302\347\273\362\306\367\274\376,\n")
printf("\262\242\307\322\265\245\316\273\262\273\312\307\300\345\303\327,\310\347\271\373\304\343\n")
printf("\310\267\310\317\320\350\322\252\324\332\264\313\326\306\327\367\272\270\305\314,\307\353\n")
printf("\320\336\270\304\265\245\316\273\316\252\300\345\303\327\n")
axlUIConfirm("\273\267\276\263\264\355\316\363\243\254\326\320\266\317\262\331\327\367\241\243")
)
)
))
unless(boundp('kevin_padcreate) kevin_padcreate = nil)
defun(quick_padcrt_form ()
let((DisplayFormfile)
DisplayFormfile = "./padcreatefor.form"
formport = outfile(DisplayFormfile "w")
fprintf(formport "FILE_TYPE=FORM_DEFN VERSION=2\n")
fprintf(formport "FORM\n")
fprintf(formport "FIXED\n")
fprintf(formport "ORT 60 6\n")
fprintf(formport "HEADER \"Quick PadCreate - kevin\"\n")
fprintf(formport "TILE\n")
fprintf(formport "\n")
fprintf(formport "TEXT \"\307\353\321\241\324\361\272\270\305\314\300\340\320\315\"\n")
fprintf(formport "TLOC 1 1\n")
fprintf(formport "ENDTEXT\n")
fprintf(formport "FIELD fuc_help\n")
fprintf(formport "FLOC 37 1\n")
fprintf(formport "MENUBUTTON \"?\" 2 2\n")
fprintf(formport "ENDFIELD \n\n")
fprintf(formport,"TABSET tabsel \n")
fprintf(formport,"FLOC 3 3\n")
fprintf(formport,"FSIZE 55 22 \n")
; ------------------通孔 正方形/圆形焊盘(内经正圆) (THS 外径正方形、内径正圆) (THC 内外径均为正圆)------------------
fprintf(formport,"TAB \"THS_THC\" THC_THS \n")
fprintf(formport "\n")
fprintf(formport "TEXT \"diameter_bgn:\"\n")
fprintf(formport "TLOC 1 1\n")
fprintf(formport "ENDTEXT\n")
fprintf(formport,"FIELD THC_THS_pthc_diameter1\n\n")
fprintf(formport,"FLOC 20 1\n")
fprintf(formport,"STRFILLIN 5 5\n")
fprintf(formport,"ENDFIELD\n\n")
fprintf(formport "\n")
fprintf(formport "TEXT \"diameter_end:\"\n")
fprintf(formport "TLOC 1 3\n")
fprintf(formport "ENDTEXT\n")
fprintf(formport,"FIELD THC_THS_pthc_diameter2\n\n")
fprintf(formport,"FLOC 20 3\n")
fprintf(formport,"STRFILLIN 5 5\n")
fprintf(formport,"ENDFIELD\n\n")
fprintf(formport "\n")
fprintf(formport "TEXT \"inc:\"\n")
fprintf(formport "TLOC 1 5\n")
fprintf(formport "ENDTEXT\n")
fprintf(formport,"FIELD THC_THS_incpthc\n\n")
fprintf(formport,"FLOC 20 5\n")
fprintf(formport,"STRFILLIN 5 5\n")
fprintf(formport,"ENDFIELD\n\n")
;----------------------------------------------------------
fprintf(formport "\n")
fprintf(formport "TEXT \"diameter_bgn:\"\n")
fprintf(formport "TLOC 30 1\n")
fprintf(formport "ENDTEXT\n")
fprintf(formport,"FIELD THC_THS_pthc_diameter1\n\n")
fprintf(formport,"FLOC 45 1\n")
fprintf(formport,"STRFILLIN 5 5\n")
fprintf(formport,"ENDFIELD\n\n")
fprintf(formport "\n")
fprintf(formport "TEXT \"diameter_end:\"\n")
fprintf(formport "TLOC 30 3\n")
fprintf(formport "ENDTEXT\n")
fprintf(formport,"FIELD THC_THS_pthc_diameter2\n\n")
fprintf(formport,"FLOC 45 3\n")
fprintf(formport,"STRFILLIN 5 5\n")
fprintf(formport,"ENDFIELD\n\n")
fprintf(formport "\n")
fprintf(formport "TEXT \"inc:\"\n")
fprintf(formport "TLOC 30 5\n")
fprintf(formport "ENDTEXT\n")
fprintf(formport,"FIELD THC_THS_incpthc\n\n")
fprintf(formport,"FLOC 45 5\n")
fprintf(formport,"STRFILLIN 5 5\n")
fprintf(formport,"ENDFIELD\n\n")
;----------------------------------------------------------
fprintf(formport "\n")
fprintf(formport "TEXT \"\272\270\305\314\313\265\303\367:\263\244\241\331\277\355\"\n")
fprintf(formport "TLOC 1 7\n")
fprintf(formport "ENDTEXT\n")
fprintf(formport "\n")
fprintf(formport "TEXT \"\303\374\303\373\267\275\267\250\243\272SMD +\263\244 X \277\355\"\n")
fprintf(formport "TLOC 1 9\n")
fprintf(formport "ENDTEXT\n")
fprintf(formport "\n")
fprintf(formport "TEXT \"\303\374\303\373\276\331\300\375\243\272SMD0R90 X 0R70\"\n")
fprintf(formport "TLOC 1 11\n")
fprintf(formport "ENDTEXT\n")
fprintf(formport "\n")
fprintf(formport "TEXT \"\272\270\305\314\313\265\303\367:\263\244=\277\355\"\n")
fprintf(formport "TLOC 25 7\n")
fprintf(formport "ENDTEXT\n")
fprintf(formport "\n")
fprintf(formport "TEXT \"\303\374\303\373\267\275\267\250\243\272SMDS + \272\270\305\314\261\337\263\244\"\n")
fprintf(formport "TLOC 25 9\n")
fprintf(formport "ENDTEXT\n")
fprintf(formport "\n")
fprintf(formport "TEXT \"\303\374\303\373\276\331\300\375\243\272SMDS0R90\"\n")
fprintf(formport "TLOC 25 11\n")
fprintf(formport "ENDTEXT\n")
fprintf(formport "FIELD THC_THS_circular\n")
fprintf(formport "FLOC 1 15\n")
fprintf(formport "MENUBUTTON \"\264\264\275\250\" 8 3\n")
fprintf(formport "ENDFIELD \n\n")
fprintf(formport "FIELD THC_THS_reset\n")
fprintf(formport "FLOC 16 15\n")
fprintf(formport "MENUBUTTON \"\263\365\312\274\326\265\" 8 3\n")
fprintf(formport "ENDFIELD \n\n")
fprintf(formport "FIELD cacel\n")
fprintf(formport "FLOC 30 15\n")
fprintf(formport "MENUBUTTON \"\315\313\263\366\" 8 3\n")
fprintf(formport "ENDFIELD \n\n")
fprintf(formport,"ENDTAB \n")
fprintf(formport,"ENDTABSET \n")
fprintf(formport "ENDTILE\n")
fprintf(formport "ENDFORM\n")
close(formport)
displayform = axlFormCreate('kevin_padcreate DisplayFormfile '(se inner) 'PadCreate_Act t)
axlFormDisplay(displayform)
axlUIWPrint(displayform "Kevin Wong")
deleteFile("padcreatefor.form")
; ---------------------------------
axlFormSetField(displayform "THC_THS_pthc_diameter1" "0.2")
axlFormSetField(displayform "THC_THS_pthc_diameter2" "3")
axlFormSetField(displayform "THC_THS_incpthc" "0.1")
)
)
defun( PadCreate_Act (displayform)
let(()
case(displayform -> curField
; ---------------------------------
("THC_THS_circular"
axlUIWPrint(displayform "Kevin Wong")
a1 = atof(axlFormGetField(displayform "THC_THS_pthc_diameter1"))
a2 = atof(axlFormGetField(displayform "THC_THS_pthc_diameter2"))
c = atof(axlFormGetField(displayform "THC_THS_incpthc"))
if((c==0)
then
THC_THS_Create(a1)
else
if( (or(not(and(a1 a2 c)) a1==0 a2==0 a1>a2)== t)
then
axlUIConfirm("\307\353\312\344\310\353\325\375\310\267\265\304\262\316\312\375\243\241")
axlUIWPrint(displayform "\262\316\312\375\264\355\316\363\243\241")
else
while( (a1<=a2)
THC_THS_Create(a1)
a1 = a1 + c
)
)
)
)
("THC_THS_reset"
axlUIWPrint(displayform "Kevin Wong")
axlFormSetField(displayform "THC_THS_pthc_diameter1" "0.2")
axlFormSetField(displayform "THC_THS_pthc_diameter2" "3")
axlFormSetField(displayform "THC_THS_incpthc" "0.1")
)
; -----------------------------------
("cacel"
axlFormClose(displayform)
deleteFile(DisplayFormfile)
)
("fuc_help"
axlUIViewFileCreate("./pad_create_help.log" "ad Create Help" nil);退出后删除log文件
)
)
))
; -----------------------------------
; load("Quick_PadCreate.il") Th_Create(1.0)
defun(THC_THS_Create (THC_THS_d)
let( (pad_namec pad_names pad_list ps_id drill_data pad_bottom pad_default)
;焊环宽度
if((THC_THS_d<=1.0) pad_ring = 0.3)
if((THC_THS_d>1.0 && THC_THS_d<2.0) pad_ring = 0.4)
if((THC_THS_d>=2.0) pad_ring = 0.5)
; -----------------------------------
pad_namec = strcat("THC" buildString(parseString(sprintf(nil "%.2f" THC_THS_d+pad_ring) ".") "R") "D" buildString(parseString(sprintf(nil "%.2f" THC_THS_d) ".") "R"))
if(axlDBFindByName('padstack pad_namec)!= nil
then
printf("ad %s is allready exist,jump it.\n" pad_namec)
else
drill_data = make_axlPadStackDrill(?drillDiameter THC_THS_d ?figure 'CIRCLE, ?figureSize THC_THS_d:THC_THS_d, ?plating 'PLATED)
pad_list = cons(make_axlPadStackPad(?layer "TOP", ?type 'REGULAR,?figure 'CIRCLE, ?figureSize THC_THS_d+pad_ring:THC_THS_d+pad_ring) nil)
pad_list = cons(make_axlPadStackPad(?layer "BOTTOM", ?type 'REGULAR,?figure 'CIRCLE, ?figureSize THC_THS_d+pad_ring:THC_THS_d+pad_ring) pad_list)
pad_list = cons(make_axlPadStackPad(?layer "DEFAULT INTERNAL", ?type 'REGULAR,?figure 'CIRCLE, ?figureSize THC_THS_d+pad_ring:THC_THS_d+pad_ring) pad_list)
pad_list = cons(make_axlPadStackPad(?layer "SOLDERMASK_TOP", ?type 'REGULAR,?figure 'CIRCLE, ?figureSize THC_THS_d+pad_ring+0.1:THC_THS_d+pad_ring+0.1) pad_list)
pad_list = cons(make_axlPadStackPad(?layer "SOLDERMASK_BOTTOM", ?type 'REGULAR,?figure 'CIRCLE, ?figureSize THC_THS_d+pad_ring+0.1:THC_THS_d+pad_ring+0.1) pad_list)
; pad_thermal =
; pad_anti=
; pad_list = cons(pad_solderbtm cons(pad_soldertop cons(pad_default cons(pad_bottom pad_list))))
flash_name = strcat("FLASH" buildString(parseString(sprintf(nil "%.2f" THC_THS_d+pad_ring) ".") "_") "X" buildString(parseString(sprintf(nil "%.2f" THC_THS_d) ".") "_"))
; allflash = axlDBGetDesign()->symdefs ;DBID
if(SymoblFlash_judge(flash_name)
then
printf("Flash %s is allready exist,jump it.\n" flash_name)
else
Flash_Create(THC_THS_d THC_THS_d+pad_ring)
)
; 使用创建的flash做热焊盘
pad_list = cons(make_axlPadStackPad(?layer "DEFAULT INTERNAL", ?type 'THERMAL,?figure 'FLASH, ?flash flash_name ?figureSize 80:80) pad_list)
;隔离为8mil
pad_list = cons(make_axlPadStackPad(?layer "DEFAULT INTERNAL", ?type 'ANTIPAD,?figure 'CIRCLE, ?figureSize (THC_THS_d+pad_ring+0.2)THC_THS_d+pad_ring+0.2)) pad_list)
ps_id = axlDBCreatePadStack(pad_namec, drill_data, pad_list t)
printf("Circle through pad %s Created successfully.\n" pad_namec)
)
; -----------------------------------
pad_names = strcat("THS" buildString(parseString(sprintf(nil "%.2f" THC_THS_d+pad_ring) ".") "R") "D" buildString(parseString(sprintf(nil "%.2f" THC_THS_d) ".") "R"))
if(axlDBFindByName('padstack pad_names)!= nil
then
printf("Pad %s is allready exist,jump it.\n" pad_names)
else
drill_data = make_axlPadStackDrill(?drillDiameter THC_THS_d ?figure 'CIRCLE, ?figureSize THC_THS_d:THC_THS_d, ?plating 'PLATED)
pad_list = cons(make_axlPadStackPad(?layer "TOP", ?type 'REGULAR,?figure 'SQUARE, ?figureSize THC_THS_d+pad_ring:THC_THS_d+pad_ring) nil)
pad_list = cons(make_axlPadStackPad(?layer "BOTTOM", ?type 'REGULAR,?figure 'SQUARE, ?figureSize THC_THS_d+pad_ring:THC_THS_d+pad_ring) pad_list)
pad_list = cons(make_axlPadStackPad(?layer "DEFAULT INTERNAL", ?type 'REGULAR,?figure 'CIRCLE, ?figureSize THC_THS_d+pad_ring:THC_THS_d+pad_ring) pad_list)
pad_list = cons(make_axlPadStackPad(?layer "SOLDERMASK_TOP", ?type 'REGULAR,?figure 'SQUARE, ?figureSize THC_THS_d+pad_ring+0.1:THC_THS_d+pad_ring+0.1) pad_list)
pad_list = cons(make_axlPadStackPad(?layer "SOLDERMASK_BOTTOM", ?type 'REGULAR,?figure 'SQUARE, ?figureSize THC_THS_d+pad_ring+0.1:THC_THS_d+pad_ring+0.1) pad_list)
; 使用创建的flash做热焊盘
pad_list = cons(make_axlPadStackPad(?layer "DEFAULT INTERNAL", ?type 'THERMAL,?figure 'FLASH, ?flash flash_name ?figureSize 80:80) pad_list)
;隔离为8mil
pad_list = cons(make_axlPadStackPad(?layer "DEFAULT INTERNAL", ?type 'ANTIPAD,?figure 'CIRCLE, ?figureSize (THC_THS_d+pad_ring+0.2)THC_THS_d+pad_ring+0.2)) pad_list)
ps_id = axlDBCreatePadStack(pad_names, drill_data, pad_list t)
printf("Square through pad %s Created successfully.\n" pad_names)
)
))
; -----------------------------------
defun(Flash_Create (inner_d outer_d )
let( (spoke xlocp_in ylocp_in xlocp_out ylocp_out f_path f_creat flashdef)
; flash名称 : FLASH1_0x0_7
flash_name = strcat("FLASH" buildString(parseString(sprintf(nil "%.2f" outer_d) ".") "_") "X" buildString(parseString(sprintf(nil "%.2f" inner_d) ".") "_"))
; 开口最小为10mil;角度45°;
if(inner_d<=0.5 spoke = 0.2)
if((inner_d>0.5 ) spoke = inner_d*0.4)
; 花焊盘:内径=hole+8mil;
if(inner_d<=0.3
then
inner_d = inner_d + 0.1
else
inner_d = inner_d + 0.2
)
; 花焊盘:外径=pad+8mil;
outer_d = outer_d + 0.2
xlocp_in = (sqrt(inner_d*inner_d-0.25*spoke*spoke)+0.5*spoke)/sqrt(2)
ylocp_in = xlocp_in - sqrt(2)/2*spoke
xlocp_out = (sqrt(outer_d*outer_d-0.25*spoke*spoke)+0.50*spoke)/sqrt(2.00)
ylocp_out = xlocp_out - sqrt(2)/2.00*spoke
flashdef = axlDBCreateSymDefSkeleton((list flash_name "flash") list(-100:-100 100:100))
; 右侧
fr_path = axlPathStart( (list xlocp_in:ylocp_in))
axlPathLine( fr_path, 0.0, xlocp_out:ylocp_out )
axlPathArcCenter(fr_path, 0.0, xlocp_out:-ylocp_out, t, 0:0)
axlPathLine( fr_path, 0.0, xlocp_in:-ylocp_in )
axlPathArcCenter(fr_path, 0.0, xlocp_in:ylocp_in, nil, 0:0)
f_creat = axlDBCreateShape(fr_path t "ETCH/TOP" nil flashdef)
; 上侧
fu_path = axlPathStart( list(-ylocp_in:xlocp_in))
axlPathLine( fu_path, 0.0, -ylocp_out:xlocp_out )
axlPathArcCenter(fu_path, 0.0, ylocp_out:xlocp_out, t, 0:0)
axlPathLine( fu_path, 0.0, ylocp_in:xlocp_in )
axlPathArcCenter(fu_path, 0.0, -ylocp_in:xlocp_in, nil, 0:0)
f_creat = axlDBCreateShape(fu_path t "ETCH/TOP" nil flashdef)
; 左侧
fl_path = axlPathStart( list(-xlocp_in:-ylocp_in))
axlPathLine( fl_path, 0.0, -xlocp_out:-ylocp_out )
axlPathArcCenter(fl_path, 0.0, -xlocp_out:ylocp_out, t, 0:0)
axlPathLine( fl_path, 0.0, -xlocp_in:ylocp_in )
axlPathArcCenter(fl_path, 0.0, -xlocp_in:-ylocp_in, nil, 0:0)
f_creat = axlDBCreateShape(fl_path t "ETCH/TOP" nil flashdef)
; 下侧
fb_path = axlPathStart( list(ylocp_in:-xlocp_in))
axlPathLine( fb_path, 0.0, ylocp_out:-xlocp_out )
axlPathArcCenter(fb_path, 0.0, -ylocp_out:-xlocp_out, t, 0:0)
axlPathLine( fb_path, 0.0, -ylocp_in:-xlocp_in )
axlPathArcCenter(fb_path, 0.0, ylocp_in:-xlocp_in, nil, 0:0)
f_creat = axlDBCreateShape(fb_path t "ETCH/TOP" nil flashdef)
printf("Flash %s Created successfully.\n" flash_name)
; )
))
defun(SymoblFlash_judge (curflashname)
prog( (allflash one judge)
axlDBRefreshId(nil)
allflash = axlDBGetDesign()->symdefs ;DBID
judge = nil
foreach(one allflash
flashname = one->name
if(flashname == curflashname
judge = t
)
)
return(judge)
)
)
|
|