How and where does KiCAD remember Gerber Plotting settings?

After finishing a layout, I go to File → Fabrication Outputs → Gerbers

First thing I note is that no matter which options I select/unselect in the panel, i.e. no matter which settings I change in the dialog, those changes are not saved and gone once I leave the dialog by pressing the “Close” button. Means closing and reopening results in the last modifications are gone. So I execpted that there is something like “Save settings there”. But it seems there is not. The “save” button seems to be just related to saving the results of Gerber generation (maybe it should then be named “save report” instead?

Then I saw that as soon as I press the “Plot” Button, it seems that from this time on, the settings are saved somewhere since they are remembered between dialog invocations. Had the thought of maybe this information is stored inside the created “.gbrjob” file that is created but no - the settings stay there even If i delet this file frmo my Project dir.

So where and how are those settings stored and remembered by KiCAD and what Is the recommended way of saving all the gerber file generation options so I can reproduce them later on by again loading a setting file in the GUI or maybe even using the CLI?

Thanks

Application: KiCad PCB Editor x64 on x64
Version: 8.0.6, release build
Libraries:
wxWidgets 3.2.6
FreeType 2.13.2
HarfBuzz 9.0.0
FontConfig 2.14.2
libcurl/8.8.0-DEV Schannel zlib/1.3.1
Platform: Windows 10 (build 19045), 64-bit edition, 64 bit, Little endian, wxMSW
OpenGL: ATI Technologies Inc., AMD Radeon™ Graphics, 4.6.0 Compatibility Profile Context 22.20.27.09.230330

IIRC the pcbnew.json file in the preferences directory so applies to all your projects. And yes it’s only saved when a plot is done.

Does not seem to be the case. I changed some checkboxes, plotted the gerbers again and “monitored” the pcbnew.json during that process. No changes made to the file by KiCAD

Try closng the project or at least the PCB editor before you check.

Indeed, closing the PCB Editor writes to the file, but I do not see relevant information stored here. It onily changes two lines. Once the “perspective” property and the “file_history”. No info regarding the fabrication output stored there as it seems

Did you do a plot after changing Gerber settings?

Yes, opened the PCB, changed some checkboxes in Gerber output, plotted, closed Kicad, compared file

:person_shrugging:

I think it’s in the .kicad_pcb file. I see this line in it:

                        (layerselection 0x00010fc_ffffffff)

which looks like a bitmask.

I seem to remember in some earlier version it was global (for the user) which caused changing the layers in one project affect another.

I don’t like that there are no at least 2 separate configurations you can name and save.
For each PCB I use this window for two tasks:

  • to generate gerbers,
  • to generate documentation in SVG format.

I start new PCB revision from copying previous revision. When I then came to generate gerbers I have to change settings here as in copied project last what I have done was generating documentation files. Then after checking that gerbers look correct I have to change settings back again to generate SVGs.

In my opinion settings could be saved separatelly for each Plot format.

As I have just finished filling one bug report may be I will go back there to write it.

Not a solution to the problem behind the question, but for a reliable and steady workflow i switched to a gerber generating plugin, to be specific the JLC PCB fabrication toolkit (GitHub - bennymeg/Fabrication-Toolkit: An JLC PCB Fabrication Plugin for KiCad). Its in the plugin manager, too. With this I can be sure that all my pcb get exported the same way, with one click, automatically moving the old exported version in a backup folder.
And of course the gerber is not only just for jlc, works with aisler and pcbway too (and others).
There are other of such plugins, but personally i settled for that, as it takes over the export, but doesn’t auto push to a fixed board house, like some do.

So maybe worth a look to not need to remember and set all the options manually every time.

I know the plugin and already used it, but there are some shortcomings and open issues that do not seem to be adressed by the autor (no offense, just an observation).
For example, It always blows out ALL the layers, regardless to which I actually need. Also it seems the coordinates used do not reflect the drill/placement file origin I set in KiCAD but always stay in the upper left corner. Further, it seems that the settings I do in KiCAD regarding origins and “orientation” of axes for coordinates are ignored by the plugin. So I would say the problem is that I am not sure what settings the plugin actually takes from KiCAD, i.e. which settings have effect on the output. I do not see a specific documentation, semms more like a blackbox.
This is why I try to automate the file geenration using KiCAD built-in stuff and the CLI

1 Like

I can fully understand that. And i wish for an more “in KiCad” Solution, too.

I have written this:

You can comment if you think something else should ba said.

1 Like

A speed how KiCad team works always amazes me.
When I was getting a link to bug report (I had a break between issuing it and then searching it to copy it here) I just post a moment ago I noticed “I don’t see my previous today bug report - where the hell it is?”
I found it among closed ones :slight_smile: :

For PCB, the plot setting are in the project’s .kicad_pcb file except for the plot directory which is in the .kicad_pro file.