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.
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?
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.
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.
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.