Author Topic: Batch script to rename Gerber file extensions.  (Read 2854 times)

0 Members and 1 Guest are viewing this topic.

Offline sukuTopic starter

  • Contributor
  • Posts: 46
  • Country: hu
Batch script to rename Gerber file extensions.
« on: October 27, 2017, 12:45:43 pm »
I use Proteus 8 and when I use the old gerber format (RS274X) it spits out *.GBR files. The fabhouse (PCBWay) wants all the files to have different extensions (.GBL for bottom layer, .GBO for silkscreen overlay etc...) Having the rename all of the files gets tiring quite fast so I wrote a batch script to automate the process...

I always check gerber files before production just to make sure everything is fine (Free Online 3D gerber viewer: http://mayhewlabs.com/webGerber/) and guess what, the batch file works great!  :-+

If you want to use it yourself you'll probably have to modify a couple of things but the script is so simple that pretty much anyone could do it! (Also don't hold me responsible if anything goes wrong :-// )

I linked in below to script and a screenshot of what it does. enjoy!



GerberCNV.bat
Code: [Select]
REM =========== RENAME TOP LAYER FILES ================

rename "*- CADCAM Top Copper.GBR"           "*- Top Copper.GTL" 
rename "*- CADCAM Top Silk Screen.GBR"      "*- Top Silk.GTO"
rename "*- CADCAM Top Solder Resist.GBR"    "*- Top Resist.GTS" 
rename "*- CADCAM Top SMT Paste.GBR"        "*- Top Paste.GTP" 

REM =========== RENAME BOTTOM LAYER FILES =============

rename "*- CADCAM Bottom Copper.GBR"        "*- Bottom Copper.GBL"
rename "*- CADCAM Bottom Silk Screen.GBR"   "*- Bottom Silk.GBO"
rename "*- CADCAM Bottom Solder Resist.GBR" "*- Bottom Resist.GBS"
rename "*- CADCAM Bottom SMT Paste.GBR"     "*- Bottom Paste.GBP" 


REM =========== RENAME DRILL & MECH FILES =============

rename "*- CADCAM Mechanical 1.GBR"         "*- Mechanical.GBR" 
rename "*- CADCAM Mechanical 2.GBR"         "*- Routing.GBR" 
rename "*- CADCAM Mechanical 3.GBR"         "*- Board Outline.GKO"
rename "*- CADCAM Mechanical 4.GBR"         "*- Documentation.GBR" 
rename "*- CADCAM Drill.DRL"                "*- Drill.DRD" 
 

Offline DerekG

  • Frequent Contributor
  • **
  • Posts: 882
  • Country: nf
Re: Batch script to rename Gerber file extensions.
« Reply #1 on: October 27, 2017, 01:06:56 pm »
Great work, but we have used PCBWAY quite a lot & DipTrace spits out the Gerbers in the same format as Proteus ............ and PCBWAY have never complained to me about the format.

Having said that, I note that Altium spits out the Gerbers in the format that PCBWAY prefer.
I also sat between Elvis & Bigfoot on the UFO.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf