Nick740492 发表于 2019-8-26 20:40 redefined,就是你的procedure重新加载并定义了,也就是更新过了 |
| 找到原因了,多谢各位大神的指导 |
|
本帖最后由 Nick740492 于 2019-8-27 08:23 编辑 找到原因了,大神们的指导与浏览,谢谢 |
| 请问skill大师们,为什么我第二次load 这个skill程序的时候出现function redefined啊。这个是怎么回事啊。请大师指导下,非常感谢 |
放飞自我 发表于 2019-8-26 17:12 好的,多谢了啊,我这边其实已经改掉了和你上面检查的东西,就是没有进行判断文件是否存在 现在又发现strcat那边有问题,好像strcat起来的string会多一个./,请帮忙一并看看啊。谢谢大师了 |
| 好的,多谢了啊,我这边其实已经改掉了和你上面检查的东西,就是没有进行判断文件是否存在 |
Nick740492 发表于 2019-8-26 14:20 我不是大师 ![]() 看了一下,有以下几个地方 axlCmdRegister("releasefile" 'releasefile ?cmdType "General") procedure( releasefile() designnameandpath=axlDMFileParts(axlGetDrawingName()) designpath=nth(0 designnameandpath) designname=nth(1 designnameandpath) rexComplie("_PCB_") ; 函数改为rexCompile gerbername=rexReplace(designname "_GERBER_" 0) stencilname=rexReplace(designname "_STENCIL_" 0) releasefile=createDir("Releasefile") gerberfilename=strcat("./Releasefile" "/" gerbername) stencilfilename=strcat("./Releasefile" "/" stencilname) gerberfile=createDir(gerberfilename) stencilfile=createDir(stencilfilename) drcerror=axlDBGetDesign()->drcs if((drcerror!=nil) then yesnocancel=axlUIYesNo("DRC exist in this design, Wouldyou like to clear them all?") if((yesnocancel!=1) then ; YesNo只返回t和nil。改为if(!yesnocancel)不理会DRC继续导出光绘 axlShell("replay artwork.scr") axlShell("replay componentreport.scr") else print(" lease Check the DRCs."))) if((drcerror==nil) then axlShell("replay artwork.scr") axlShell("replay componentreport.scr") ) ;这一部分可以和上面合并 filename=getDirFiles("./GBR") ;没看懂这个GBR文件夹哪里来的,还是原来就存在的? filename1=remove("." filename) filename2=remove(".." filename1) filenamelength=length(filename2)-1 for( i 0 filenamelength name=nth(i filename2) fileorigpath=strcat("." "/" "GBR" "/" name) filedestpath=strcat("." "/" gerberfilename "/" name) axlOSFileCopy(fileorigpath filedestpath t) ) currentpath=getWorkingDir() stencilpath1=strcat(currentpath "/" stencilfilename "/" "silk_top.art") axlOSFileCopy("./GBR/silk_top.art" stencilpath1 t) stencilpath2=strcat(currentpath "/" stencilfilename "/" "silk_bottom.art") axlOSFileCopy("./GBR/silk_bottom.art" stencilpath2 t) stencilpath3=strcat(currentpath "/" stencilfilename "/" "pmask_top.art") axlOSFileCopy("./GBR/pmask_top.art" stencilpath3 t) stencilpath4=strcat(currentpath "/" stencilfilename "/" "pmask_bottom.art") axlOSFileCopy("./GBR/pmask_bottom.art" stencilpath1 t) redmefilepath=strcat(currentpath "/" stencilfilename "/" "README.txt") axlOSFileCopy("D:/README.txt readmefilepath t) ;缺少双引号 brdpath=strcat("./" designname ".brd") brdtoreleasefile=strcat("./Releasefile" "/" designname ".brd") axlOSFileCopy(brdpath brdtoreleasefile t) ) 另外,如果要运行第二次,最好在创建文件夹和文件之前做一下文件夹和文件是否存在的判断。程序第二次运行,建议把第一次产生的gerber删除掉。 |
放飞自我 发表于 2019-8-26 14:02 请大师帮忙看看啊。也请指导一下,多谢了 |
放飞自我 发表于 2019-8-26 14:02 axlCmdRegister("releasefile" 'releasefile ?cmdType "General") procedure( releasefile() designnameandpath=axlDMFileParts(axlGetDrawingName()) designpath=nth(0 designnameandpath) designname=nth(1 designnameandpath) rexComplie("_PCB_") gerbername=rexReplace(designname "_GERBER_" 0) stencilname=rexReplace(designname "_STENCIL_" 0) releasefile=createDir("Releasefile") gerberfilename=strcat("./Releasefile" "/" gerbername) stencilfilename=strcat("./Releasefile" "/" stencilname) gerberfile=createDir(gerberfilename) stencilfile=createDir(stencilfilename) drcerror=axlDBGetDesign()->drcs if((drcerror!=nil) then yesnocancel=axlUIYesNo("DRC exist in this design, Wouldyou like to clear them all?") if((yesnocancel!=1) then axlShell("replay artwork.scr") axlShell("replay componentreport.scr") else print("Please Check the DRCs.") )) if((drcerror==nil) then axlShell("replay artwork.scr") axlShell("replay componentreport.scr") ) filename=getDirFiles("./GBR") filename1=remove("." filename) filename2=remove(".." filename1) filenamelength=length(filename2)-1 for( i 0 filenamelength name=nth(i filename2) fileorigpath=strcat("." "/" "GBR" "/" name) filedestpath=strcat("." "/" gerberfilename "/" name) axlOSFileCopy(fileorigpath filedestpath t) ) currentpath=getWorkingDir() stencilpath1=strcat(currentpath "/" stencilfilename "/" "silk_top.art") axlOSFileCopy("./GBR/silk_top.art" stencilpath1 t) stencilpath2=strcat(currentpath "/" stencilfilename "/" "silk_bottom.art") axlOSFileCopy("./GBR/silk_bottom.art" stencilpath2 t) stencilpath3=strcat(currentpath "/" stencilfilename "/" "pmask_top.art") axlOSFileCopy("./GBR/pmask_top.art" stencilpath3 t) stencilpath4=strcat(currentpath "/" stencilfilename "/" "pmask_bottom.art") axlOSFileCopy("./GBR/pmask_bottom.art" stencilpath1 t) redmefilepath=strcat(currentpath "/" stencilfilename "/" "README.txt") axlOSFileCopy("D:/README.txt readmefilepath t) brdpath=strcat("./" designname ".brd") brdtoreleasefile=strcat("./Releasefile" "/" designname ".brd") axlOSFileCopy(brdpath brdtoreleasefile t) ) |
| 有源码么,看看 |
/1
关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )
GMT+8, 2025-11-22 10:28 , Processed in 0.171875 second(s), 30 queries , Gzip On.
地址:深圳市南山区科技生态园2栋A座805 电话:19926409050