XYX365 发表于 2013-7-2 08:47:44

如何將Version 16.x 降到Version 15.7的代碼

本帖最后由 XYX365 于 2013-7-2 08:51 编辑

要使用以下的代碼,必須安裝多個版本的Allegro才能使用.
V16.5以上的話必須降到V16.3以下,才能再降到V15.7axlCmdRegister("16to15" 'fnExportV16xToV15xMain ?cmdType "general")

procedure(fnExportV16xToV15xMain()
prog(()
      fVersion = axlVersion('version)
      tDesignFullName = axlGetDrawingName()
      tDesignType = axlDesignType(t)
      tHomePath = getShellEnvVar("CDSROOT")
      if(fVersion > 16.0 then
          unless(getShellEnvVar("DOWNREV_16_TO_15") setShellEnvVar("DOWNREV_16_TO_15=1"))
          if(fVersion == 16.01 then
                tDesignFileName = car(reverse(parseString(tDesignFullName "/")))
                case(tDesignType
                  ("BOARD"
                        t15xFileName = strcat(cadr(reverse(parseString(tDesignFileName "."))) "_157.brd")
                  )
                  ("PACKAGE"
                        t15xFileName = strcat(cadr(reverse(parseString(tDesignFileName "."))) "_157.dra")
                )
            )
            tDownSoftware = strcat(tHomePath "\\tools\\pcb\\bin\\vc5\\downrev15.exe")
            if(isExecutable(tDownSoftware) then
                when(isFile(t15xFileName)
                  deleteFile(t15xFileName)
                )
sprintf(tSvaeFileCmd "%s %s -outfile %s " tDownSoftware tDesignFileName t15xFileName)
bResult = axlRunBatchDBProgram("Downrev15" tSvaeFileCmd ?startMsg "Save design to 15.7 Start..." ?silent t)
printf("Downrev Finish.")
deleteFile(strcat(car(parseString(tDesignFileName ".")) ".log"))
else
printf("Can not find downrev15.exe")
return(nil)
)
else
if(fVersion < 16.5 then case(tDesignType
("BOARD"
tNewDesignFileName = strcat(cadr(reverse(parseString(tDesignFullName "/."))) "_New1601.brd")
)
("PACKAGE"
tNewDesignFileName = strcat(cadr(reverse(parseString(tDesignFullName "/."))) "_New1601.dra")
)
)
when(isFile(tNewDesignFileName)
deleteFile(tNewDesignFileName)
)
tScriptFileName=axlTempFile()
pScriptFile=outfile(tScriptFileName "w")
fprintf(pScriptFile "setwindow pcb\n")
fprintf(pScriptFile "downrev \n")
fprintf(pScriptFile "setwindow form.downrev\n")
fprintf(pScriptFile "FORM downrev downrev \n")
fprintf(pScriptFile "fillin \"%s\"\n" tNewDesignFileName)
fprintf(pScriptFile "FORM downrev close\n")
close(pScriptFile)
sprintf(tRunScriptCommand,"replay %s",tScriptFileName)
axlShell(tRunScriptCommand)
deleteFile(tScriptFileName)
deleteFile("downrev.log")
case(tDesignType
("BOARD"
t15xFileName = strcat(cadr(reverse(parseString(tNewDesignFileName "."))) "_157.brd")
)
("PACKAGE"
t15xFileName = strcat(cadr(reverse(parseString(tNewDesignFileName "."))) "_157.dra")
)
)
case(fVersion
(16.2
tDownSoftware = strcat(tHomePath "\\tools\\pcb\\bin\\vc5\\downrev15.exe"
)
(16.3
tDownSoftware = strcat(tHomePath "\\tools\\pcb\\bin\\vc5\\downrev15.exe"
)
(16.5
tDownSoftware = strcat(tHomePath "\\tools\\pcb\\bin\\vc5\\downrev15.exe"
)
(t
tDownSoftware = strcat(tHomePath "\\tools\\pcb\\bin\\vc5\\downrev15.exe"
)
)
if(isExecutable(tDownSoftware) then
when(isFile(t15xFileName)
deleteFile(t15xFileName)
)
sprintf(tSvaeFileCmd "%s %s -outfile %s " tDownSoftware tNewDesignFileName t15xFileName)
bResult = axlRunBatchDBProgram("Downrev15" tSvaeFileCmd ?startMsg "Save design to 15.7 Start..." ?silent t)
printf("Downrev Finish.")
deleteFile(strcat(car(parseString(tNewDesignFileName ".")) ".log"))
else
printf("Can not find downrev15.exe")
return(nil)
)
else
case(tDesignType
("BOARD"
tNewDesignFileName = strcat(cadr(reverse(parseString(tDesignFullName "/."))) "_New162.brd")
)
("PACKAGE"
tNewDesignFileName = strcat(cadr(reverse(parseString(tDesignFullName "/."))) "_New162.dra")
)
)

tScriptFileName=axlTempFile()
pScriptFile=outfile(tScriptFileName "w")
fprintf(pScriptFile "setwindow pcb\n")
fprintf(pScriptFile "downrev \n")
fprintf(pScriptFile "setwindow form.downrev\n")
fprintf(pScriptFile "FORM downrev save2 YES \n")
fprintf(pScriptFile "FORM downrev save\n")
fprintf(pScriptFile "fillin \"%s\"\n" tNewDesignFileName)
fprintf(pScriptFile "FORM downrev close\n")
close(pScriptFile)
sprintf(tRunScriptCommand,"replay %s",tScriptFileName)
axlShell(tRunScriptCommand)
deleteFile(tScriptFileName)
deleteFile("downrev.log")
)
)
else
return(nil)
)
)
)

shape 发表于 2013-7-2 15:58:42

谢谢分享!!{:soso_e179:}

appler 发表于 2013-8-27 13:12:08

看起来很庞大

cchh0k 发表于 2013-8-27 14:07:03

记得我们之前是用一个批处理语句就可以转了

cchh0k 发表于 2013-8-27 14:07:42

记得我们之前是用一个批处理语句就可以转了

冷青瓷 发表于 2014-3-11 09:43:05

谁知道批处理怎么转呢?

Marcen 发表于 2014-3-19 21:34:18

谢谢分享。。。:P

冷青瓷 发表于 2014-3-28 08:48:36

15.7的安装破解包,谁有呢?群里有我的Q号,谁发我一份

srqrs 发表于 2014-4-2 17:54:45

不错 支持;

這侽孓譙悴丶 发表于 2014-4-12 12:45:43

这个能改成降到15.5的吗?
页: [1] 2 3
查看完整版本: 如何將Version 16.x 降到Version 15.7的代碼