Change Column Names in CPL Output

Hi, I am exporting component placement files for use with JLC PCBs SMT fabrication service. One annoying thing that has come up is that the column names needed by their service are different from the ones kicad exports by default, and I’ve been having to change them by hand.

Here is the change that needs to happen:

This is extremely annoying since every time I catch a small change I need to make (quite frequent on complex designs) I need to re-export the file and edit it manually all over again. Is there any way to change the default names the CPL uses?

Giving this a bump. Please help!

The usual answer for any repetitive action is scripting. When I was experimenting with ordering PCBA from JLCPCB, I used this sed script on Linux on the CPL file where $cpl is substituted with the CSV CPL file. In my workflow this is driven by a Makefile.

sed -i '1s/Ref,Val,Package,PosX,PosY,Rot,Side/Designator,Val,Package,Mid X,
Mid Y,Rotation,Layer/' $cpl

You could whatever tools you have on hand: Python, Ruby, Perl, etc.

My experiment is blogged here.

You’ll see that later on in the process I had to adjust the rotation of some of the components. Unfortunately this isn’t a fixed transform but depends on which components differ in the KiCad and LCSC databases. For one project maybe a project specific script is still an effective solution. You’ll see in the comments that a reader of my blog suggested his PnPPP tool which is database driven.

There is a: “JLC Fabrication Toolkit” plugin for KiCad:

I have not used it myself. It appears to be based on the plugin for Aisler output. Maybe (a copy of) one of those scripts can be manipulated to generate the wanted output directly.

I have used this plugin to generate JLC PCB files.

1 Like

Thanks y’all! These look like a lot of great options. Will try them out and see what works

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.