Author Topic: Auto-rename the DipTrace gerber files for JLCPCB  (Read 1899 times)

0 Members and 1 Guest are viewing this topic.

Offline iurius

  • Contributor
  • Posts: 12
  • Country: md
Auto-rename the DipTrace gerber files for JLCPCB
« on: May 22, 2021, 04:09:48 pm »
EDIT:
Here is version 2 of the script (attached).

What's different:
1. The "installation" script copies the 7z files to its folder on C:
2. The main script is being kept separately, ready to be copied to the folder containing the gerbers. The script only refers C:\7-Zip_Extra folder when packing to zip
3. The whole action happens inside the gerbers folder (create new folders, zipping, etc) - meaning inside the folder where the script was copied (so called local folder)
Please read the short instructions and then follow the script step-by-step.

P.S. Thanks Silver Solder for suggestions!

-----------------------------------------------------------------------------------------------------------------
Hi all!

Most of people here probably know that in order to upload the gerber files from DipTrace to JLCPCB, these have to be renamed properly.
Since I had a few times the "pleasant" opportunity to do this job, I've decided to automate this process.

Here I present you (attached) the batch script for Windows that will rename the files and will zip them ready for uploading.


 *********************************************
 *                                                                              *
 *      A small CMD script to convert                             *
 *       DipTrace gerber files names                               *
 *          to JLCPCB name format                                  *
 *                                                                              *
 *                     by                                                     *
 *                   iurius                                                   *
 *            iuries(at)gmail.com                                      *
 *                                                                              *
 *********************************************
 *                                                                              *
 *             This software uses:                                     *
 *  7-Zip Extra: standalone console version                   *
 *           https://www.7-zip.org/                                  *
 *                                                                              *
 *      A big Thank You to Igor Pavlov!                           *
 *                                                                              *
 *                                                                              *
 *********************************************

Extract all files to the directory containing the DipTrace-exported gerber files.

List of files:

Read Me.txt  -  this file
DipTrace to JLCPCB.bat  -  the batch script that renames the gerber files
7za.dll,  7za.exe,  7zxa.dll   -  these are the files borrowed from Igor Pavlov to pack the gerbers to zip.
Thanks a lot!
I have marked the 7z files as HIDDEN, don't forget to check the box in explorer to see hidden files.

You may distribute the script freely!

Please don't hesitate to comment if I did something stupid. :-//
Give me a thumbs up THANK YOU if you like it!    ;)
« Last Edit: May 28, 2021, 08:11:08 pm by iurius »
Engineer's paradox:
You only learn by practice... but remember! if it works, don't touch it
 
The following users thanked this post: SilverSolder, ZigmundRat

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 5096
  • Country: 00
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #1 on: May 22, 2021, 06:04:55 pm »
Great idea!

Defaulting to drive D: may not work for everybody, but this batch file is a great starting point no matter what.

I would not mark the zip executables as hidden...  that can only lead to fear, uncertainty, and doubt!


How do you handle a single layer board - does JLCPCB not support that?
 
The following users thanked this post: iurius

Offline iurius

  • Contributor
  • Posts: 12
  • Country: md
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #2 on: May 22, 2021, 08:15:16 pm »
Great idea!

Thanks!
Defaulting to drive D: may not work for everybody, but this batch file is a great starting point no matter what.


Well, I guess I could set it to C:  ?  What do you say?


I would not mark the zip executables as hidden...  that can only lead to fear, uncertainty, and doubt!


The reason I marked the 7z files as hidden was to get them out of the view, but to still have them in the folder.
I guess I'll move them to a separate folder and call them from the script.


How do you handle a single layer board - does JLCPCB not support that?


In DipTrace there is an option to set one of 2 layers as non-signal
Engineer's paradox:
You only learn by practice... but remember! if it works, don't touch it
 

Offline iurius

  • Contributor
  • Posts: 12
  • Country: md
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #3 on: May 22, 2021, 10:06:31 pm »
Hi! The new version is available in the main post
Engineer's paradox:
You only learn by practice... but remember! if it works, don't touch it
 
The following users thanked this post: SilverSolder

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 1994
  • Country: us
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #4 on: May 23, 2021, 02:10:03 am »
You do know that you can change the filenames and
select which files are zipped up from within Diptrace.

Make the changes once and forget.

Open Diptrace PCB program then go to  File >> Export >> Gerber >> Files button.

All gerbers exported after that will have your new naming scheme (even new PCBs).
 

Offline iurius

  • Contributor
  • Posts: 12
  • Country: md
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #5 on: May 23, 2021, 09:03:34 am »
You do know that you can change the filenames and
select which files are zipped up from within Diptrace.

Make the changes once and forget.

Open Diptrace PCB program then go to  File >> Export >> Gerber >> Files button.

All gerbers exported after that will have your new naming scheme (even new PCBs).

You're right, when it comes to only one PCB manufacturer. What about if I want to send gerbers to PCBway?
In this case I can make a 2-nd copy of this script modified for PCBway.
Engineer's paradox:
You only learn by practice... but remember! if it works, don't touch it
 

Offline exe

  • Supporter
  • ****
  • Posts: 2303
  • Country: nl
  • self-educated hobbyist
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #6 on: May 23, 2021, 09:48:21 am »
Afaik last time I ordered from jlcpcb I just used "export all" function without renaming. I followed this tutorial from their website: https://support.jlcpcb.com/article/46-how-to-export-diptrace-pcb-to-gerber-files .
 

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 5096
  • Country: 00
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #7 on: May 23, 2021, 10:51:27 am »

So JLCPCB is actually not that fussy when it comes to file names, it seems?

 

Offline iurius

  • Contributor
  • Posts: 12
  • Country: md
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #8 on: May 23, 2021, 06:15:40 pm »
Afaik last time I ordered from jlcpcb I just used "export all" function without renaming. I followed this tutorial from their website: https://support.jlcpcb.com/article/46-how-to-export-diptrace-pcb-to-gerber-files .

Not this time, unfortunately. I tried couple days ago as described in the video. It did upload the zip file, but the previews were blank.
After some searching I found this:     https://support.jlcpcb.com/article/29-suggested-naming-patterns
The rest is history!  :)

P.S.  Please check version 2 of the script (attached to the main post)
« Last Edit: May 23, 2021, 06:19:03 pm by iurius »
Engineer's paradox:
You only learn by practice... but remember! if it works, don't touch it
 

Offline iurius

  • Contributor
  • Posts: 12
  • Country: md
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #9 on: May 23, 2021, 06:17:46 pm »

So JLCPCB is actually not that fussy when it comes to file names, it seems?

Used to not be fussy, seems the older it gets... ;)

P.S.  Please check version 2 of the script (attached to the main post)
« Last Edit: May 23, 2021, 06:19:20 pm by iurius »
Engineer's paradox:
You only learn by practice... but remember! if it works, don't touch it
 

Offline exe

  • Supporter
  • ****
  • Posts: 2303
  • Country: nl
  • self-educated hobbyist
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #10 on: May 23, 2021, 11:14:34 pm »
Not this time, unfortunately. I tried couple days ago as described in the video. It did upload the zip file, but the previews were blank.

Which preview was that? On this page? https://cart.jlcpcb.com/quote
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 2788
  • Country: it
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #11 on: May 24, 2021, 10:57:31 am »
i've never had to rename the gerbers.
i just give them with the proper extensions, and you don't need a script to do that: in the export window press the "files" button in the top right corner

[attachimg=1]
« Last Edit: May 24, 2021, 11:00:44 am by JPortici »
 

Offline iurius

  • Contributor
  • Posts: 12
  • Country: md
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #12 on: May 24, 2021, 09:17:28 pm »
i've never had to rename the gerbers.
i just give them with the proper extensions, and you don't need a script to do that: in the export window press the "files" button in the top right corner

[attachimg=1]

MarkF also suggested this, however this only works if you stick to one PCB manufacturer.
When you have 2 or more manufacturers it makes sense to have several modified scripts. In this scenario it would be a pain to modify the file names in DipTrace whenever you change the destination.
Engineer's paradox:
You only learn by practice... but remember! if it works, don't touch it
 

Offline iurius

  • Contributor
  • Posts: 12
  • Country: md
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #13 on: May 24, 2021, 09:24:00 pm »
Not this time, unfortunately. I tried couple days ago as described in the video. It did upload the zip file, but the previews were blank.

Which preview was that? On this page? https://cart.jlcpcb.com/quote

I've attached an image
If exporting the gerbers without renaming, the previews of the board are blank
Engineer's paradox:
You only learn by practice... but remember! if it works, don't touch it
 

Offline exe

  • Supporter
  • ****
  • Posts: 2303
  • Country: nl
  • self-educated hobbyist
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #14 on: May 25, 2021, 12:24:30 am »
If exporting the gerbers without renaming, the previews of the board are blank

This part worked for me just fine. Without renaming, do you have long filenames or filenames with spaces?
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 2788
  • Country: it
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #15 on: May 25, 2021, 08:35:46 am »
i've never had to rename the gerbers.
i just give them with the proper extensions, and you don't need a script to do that: in the export window press the "files" button in the top right corner

[attachimg=1]

MarkF also suggested this, however this only works if you stick to one PCB manufacturer.
When you have 2 or more manufacturers it makes sense to have several modified scripts. In this scenario it would be a pain to modify the file names in DipTrace whenever you change the destination.

I use several manufacturers around the globe with this extension scheme (which came from elecrow IIRC.. they were the only ones i found that were picky with the file names)
i was never asked to change it, as they can figure out that "t" stands for TOP, "b" for BOTTOM, numbers for internal layers and the last letter doesn't matter much, they can see wether is't silk or signal etc

I was asked sometimes to provide files in a different format (X-2) but in the end they were always fine with gerbers + bom in plain text or excel
« Last Edit: May 25, 2021, 08:37:48 am by JPortici »
 

Offline iurius

  • Contributor
  • Posts: 12
  • Country: md
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #16 on: May 25, 2021, 08:38:06 pm »
i've never had to rename the gerbers.
i just give them with the proper extensions, and you don't need a script to do that: in the export window press the "files" button in the top right corner

[attachimg=1]

MarkF also suggested this, however this only works if you stick to one PCB manufacturer.
When you have 2 or more manufacturers it makes sense to have several modified scripts. In this scenario it would be a pain to modify the file names in DipTrace whenever you change the destination.

I use several manufacturers around the globe with this extension scheme (which came from elecrow IIRC.. they were the only ones i found that were picky with the file names)
i was never asked to change it, as they can figure out that "t" stands for TOP, "b" for BOTTOM, numbers for internal layers and the last letter doesn't matter much, they can see wether is't silk or signal etc

I was asked sometimes to provide files in a different format (X-2) but in the end they were always fine with gerbers + bom in plain text or excel

Very useful info (regarding your extension scheme). Thank you!
It is quite strange to me to hear that pcb manufacturers would accept a common format. AFAIK they always have some rules.
Anyway, I will keep the script. You never know what comes into manufacturers heads next  :)
« Last Edit: May 25, 2021, 08:41:27 pm by iurius »
Engineer's paradox:
You only learn by practice... but remember! if it works, don't touch it
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf