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

0 Members and 1 Guest are viewing this topic.

Offline iuriusTopic starter

  • Contributor
  • Posts: 15
  • 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: 6126
  • 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 iuriusTopic starter

  • Contributor
  • Posts: 15
  • 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 iuriusTopic starter

  • Contributor
  • Posts: 15
  • 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

Online MarkF

  • Super Contributor
  • ***
  • Posts: 2515
  • 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 iuriusTopic starter

  • Contributor
  • Posts: 15
  • 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: 2557
  • 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: 6126
  • 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 iuriusTopic starter

  • Contributor
  • Posts: 15
  • 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 iuriusTopic starter

  • Contributor
  • Posts: 15
  • 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: 2557
  • 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: 3448
  • 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

« Last Edit: May 24, 2021, 11:00:44 am by JPortici »
 

Offline iuriusTopic starter

  • Contributor
  • Posts: 15
  • 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

(Attachment Link)

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 iuriusTopic starter

  • Contributor
  • Posts: 15
  • 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: 2557
  • 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: 3448
  • 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

(Attachment Link)

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 iuriusTopic starter

  • Contributor
  • Posts: 15
  • 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

(Attachment Link)

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
 

Offline AK6DN

  • Regular Contributor
  • *
  • Posts: 55
  • Country: us
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #17 on: February 05, 2023, 04:53:49 am »
I have used DipTrace for a number of years (over 10 now) and in my recent board fabrications at JLCPCB I was just able to zip up the standard DipTrace output files and upload the zip file to JLCPCB without any individual file name changes. JLCPCB correctly identified all the DipTrace gerber files in my two and four layer designs correctly. So no file name renaming appears to be required by JLCPCB.
 

Offline iuriusTopic starter

  • Contributor
  • Posts: 15
  • Country: md
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #18 on: February 06, 2023, 09:44:55 am »
I have used DipTrace for a number of years (over 10 now) and in my recent board fabrications at JLCPCB I was just able to zip up the standard DipTrace output files and upload the zip file to JLCPCB without any individual file name changes. JLCPCB correctly identified all the DipTrace gerber files in my two and four layer designs correctly. So no file name renaming appears to be required by JLCPCB.
I did that once, but my zip archive was rejected, that's why I made this script.
Could you describe (shortly) the steps you took?
Engineer's paradox:
You only learn by practice... but remember! if it works, don't touch it
 

Offline AK6DN

  • Regular Contributor
  • *
  • Posts: 55
  • Country: us
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #19 on: February 27, 2023, 02:12:38 am »
I have used DipTrace for a number of years (over 10 now) and in my recent board fabrications at JLCPCB I was just able to zip up the standard DipTrace output files and upload the zip file to JLCPCB without any individual file name changes. JLCPCB correctly identified all the DipTrace gerber files in my two and four layer designs correctly. So no file name renaming appears to be required by JLCPCB.
I did that once, but my zip archive was rejected, that's why I made this script.
Could you describe (shortly) the steps you took?

I use the standard/default DipTrace gerber file  naming conventions. Exported the gerbers and drill file to a directory. Used 7zip on the directory.
Uploaded that .zip file to JLCPCB, and it was able to identify all the gerbers correctly with the corresponding layer assignments.
 
The following users thanked this post: iurius

Offline iuriusTopic starter

  • Contributor
  • Posts: 15
  • Country: md
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #20 on: March 01, 2023, 05:16:50 pm »
I'll give it a try. Thanks!
Engineer's paradox:
You only learn by practice... but remember! if it works, don't touch it
 

Offline BillyO

  • Super Contributor
  • ***
  • Posts: 1315
  • Country: ca
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #21 on: March 03, 2023, 05:20:12 pm »
Strange,

I've been using JLCPCB for as long as I can remember, probably as long as they have been around, and I also use DipTrace.  I've been a DipTrace user since version 2.  I have never had to rename my files.  I just zip them up and plop them over to JLCPCB.

Never had a problem. :-//
« Last Edit: March 03, 2023, 05:22:29 pm by BillyO »
Bill  (Currently a Siglent fanboy)
--------------------------------------------------
Want to see an old guy fumble around re-learning a career left 40 years ago?  Well, look no further .. https://www.youtube.com/@uni-byte
 
The following users thanked this post: iurius

Offline iuriusTopic starter

  • Contributor
  • Posts: 15
  • Country: md
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #22 on: March 03, 2023, 09:39:18 pm »
Strange,

I've been using JLCPCB for as long as I can remember, probably as long as they have been around, and I also use DipTrace.  I've been a DipTrace user since version 2.  I have never had to rename my files.  I just zip them up and plop them over to JLCPCB.

Never had a problem. :-//

It is strange, because I also just zipped them and uploaded, but no no no! That's why I came with the idea of a script. Anyway, thank you!
Engineer's paradox:
You only learn by practice... but remember! if it works, don't touch it
 

Offline Marathonman

  • Newbie
  • Posts: 4
  • Country: us
Re: Auto-rename the DipTrace gerber files for JLCPCB
« Reply #23 on: March 04, 2023, 02:36:49 am »
Wow that is really weird because I have been with DT since version 2 now with 4.3.0.4 Standard and I have never had one single problem with naming convention . Using the auto setting for all then zip in a file with the drill separate from the rest. It always shows the proper file after upload and submit with all manufacturers.
Granted DT has some other weird naming conventions for terminals, Courtyard ECT...and some other BS but I click them off and don't worry about them
 
The following users thanked this post: iurius


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf