Auto-rename the DipTrace gerber files for JLCPCB - Page 1
Forum section: electronics / general

author: iurius
author_rank: Contributor
timestamp: May 22, 2021, 04:09:48 pm
content: 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 zip3. 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 fileDipTrace to JLCPCB.bat - the batch script that renames the gerber files7za.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 athumbs upTHANK YOU if you like it!

author: SilverSolder
author_rank: Super Contributor
timestamp: May 22, 2021, 06:04:55 pm
content: 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?

author: iurius
author_rank: Contributor
timestamp: May 22, 2021, 08:15:16 pm
content: Quote from: SilverSolder on May 22, 2021, 06:04:55 pmWell, I guess I could set it to C: ? What do you say?Quote from: SilverSolder on May 22, 2021, 06:04:55 pmThe 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.Quote from: SilverSolder on May 22, 2021, 06:04:55 pmIn DipTrace there is an option to set one of 2 layers as non-signal

author: iurius
author_rank: Contributor
timestamp: May 22, 2021, 10:06:31 pm
content: Hi! The new version is available in the main post

author: MarkF
author_rank: Super Contributor
timestamp: May 23, 2021, 02:10:03 am
content: You do know that you can change the filenames andselect 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).

author: iurius
author_rank: Contributor
timestamp: May 23, 2021, 09:03:34 am
content: Quote from: MarkF on May 23, 2021, 02:10:03 amYou'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.

author: exe
author_rank: Unknown
timestamp: May 23, 2021, 09:48:21 am
content: 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.

author: SilverSolder
author_rank: Super Contributor
timestamp: May 23, 2021, 10:51:27 am
content: So JLCPCB is actually not that fussy when it comes to file names, it seems?

author: iurius
author_rank: Contributor
timestamp: May 23, 2021, 06:15:40 pm
content: Quote from: exe on May 23, 2021, 09:48:21 amNot 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-patternsThe rest is history!P.S. Please check version 2 of the script (attached to the main post)

author: iurius
author_rank: Contributor
timestamp: May 23, 2021, 06:17:46 pm
content: Quote from: SilverSolder on May 23, 2021, 10:51:27 amUsed to not be fussy, seems the older it gets...P.S. Please check version 2 of the script (attached to the main post)

author: exe
author_rank: Unknown
timestamp: May 23, 2021, 11:14:34 pm
content: Quote from: iurius on May 23, 2021, 06:15:40 pmWhich preview was that? On this page?https://cart.jlcpcb.com/quote

author: JPortici
author_rank: Super Contributor
timestamp: May 24, 2021, 10:57:31 am
content: 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

author: iurius
author_rank: Contributor
timestamp: May 24, 2021, 09:17:28 pm
content: Quote from: JPortici on May 24, 2021, 10:57:31 amMarkF 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.

author: iurius
author_rank: Contributor
timestamp: May 24, 2021, 09:24:00 pm
content: Quote from: exe on May 23, 2021, 11:14:34 pmI've attached an imageIf exporting the gerbers without renaming, the previews of the board are blank

author: exe
author_rank: Unknown
timestamp: May 25, 2021, 12:24:30 am
content: Quote from: iurius on May 24, 2021, 09:24:00 pmThis part worked for me just fine. Without renaming, do you have long filenames or filenames with spaces?

author: JPortici
author_rank: Super Contributor
timestamp: May 25, 2021, 08:35:46 am
content: Quote from: iurius on May 24, 2021, 09:17:28 pmI 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 etcI 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

author: iurius
author_rank: Contributor
timestamp: May 25, 2021, 08:38:06 pm
content: Quote from: JPortici on May 25, 2021, 08:35:46 amVery 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

author: AK6DN
author_rank: Regular Contributor
timestamp: February 05, 2023, 04:53:49 am
content: 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.

author: iurius
author_rank: Contributor
timestamp: February 06, 2023, 09:44:55 am
content: Quote from: AK6DN on February 05, 2023, 04:53:49 amI did that once, but my zip archive was rejected, that's why I made this script.Could you describe (shortly) the steps you took?

author: AK6DN
author_rank: Regular Contributor
timestamp: February 27, 2023, 02:12:38 am
content: Quote from: iurius on February 06, 2023, 09:44:55 amI 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.

author: iurius
author_rank: Contributor
timestamp: March 01, 2023, 05:16:50 pm
content: I'll give it a try. Thanks!

author: BillyO
author_rank: Super Contributor
timestamp: March 03, 2023, 05:20:12 pm
content: 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.

author: iurius
author_rank: Contributor
timestamp: March 03, 2023, 09:39:18 pm
content: Quote from: BillyO on March 03, 2023, 05:20:12 pmIt 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!

author: Marathonman
author_rank: Newbie
timestamp: March 04, 2023, 02:36:49 am
content: 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