Can the grid spacing in pcbnew be persisted?

It detaults to 1.27mm at startup. I switch to 2.54mm because this project uses retro 0.1in THT components. When I exit and come back it’s back at 1.27mm. Is there a way to make the grid spacing persist on a PCB or project basis? I can’t find it anywhere in settings or Internet postings.

Using Kicad 5.1.1.

Version 5.1.1 was not released as stable. Upgrade to 5.1.2.

Ok, now on 5.1.2, but still don’t see any way to persist grid setting.

Then I can’t help you. In my system, the last grid used before closing a project is kept when I open the next project, even if the project is not the same one.

Ok, I found the answer by looking at the settings file and going with my hunch. The preset grids do not persist. I have to choose User Grid, set it to what I want then pcbnew will start with that setting next time.

I just set the grid to 2.5mils (which I normally never use), exited KiCad completely, and restarted KiCad and loaded the same board, and the 2.5mils setting persisted.

Then I set the grid to 0.5mils, Exited KiCad again, and opened another project.
That other project also has the grid currently set to 0.5mils.

I have never looked into the workings of “settings files”, but at least on my system there sems to be a persistence of the grid setting as a global thing, and not project related.

1 Like

What I saw was that there is no persistence for the presets, only for the User Grid option. There is no project specific persistence, only global (well user account to be exact) persistence. I saw no settings in the project or pcb files for storing the grid setting. Perhaps a developer can explain how it ought to work.

5.1.2 as mentioned. On Linux if it matters.

Here’s what happens when I search for 0.254 and 0.127 settings:

$ grep -r 254 .config/kicad/
.config/kicad/pcbnew:PcbFramePcbUserGrid_X=0.254
.config/kicad/pcbnew:PcbFramePcbUserGrid_Y=0.254
.config/kicad/pcbnew:ModViewFramePcbUserGrid_X=0.254
.config/kicad/pcbnew:ModViewFramePcbUserGrid_Y=0.254
.config/kicad/pcbnew:ModEditFramePcbUserGrid_X=0.254
.config/kicad/pcbnew:ModEditFramePcbUserGrid_Y=0.254
.config/kicad/pcbnew:ModViewFrameModalPcbUserGrid_X=0.254
.config/kicad/pcbnew:ModViewFrameModalPcbUserGrid_Y=0.254
$ grep -r 127 .config/kicad/
$

So I’m fairly confident that pcbnew only persists User Grid settings, not the presets, on a per account basis in this version, since it always reverts to 0.127 if User Grid is not in effect.

Not in my case. Pcbnew grid is globally persistent whatever the grid I have selected.

Selecting through the preset? On Linux?

What do you mean with preset here? Where exactly do you select the grid? A screenshot might make it even clearer.

Don’t know what preset is. And yes, on linux kubuntu and kicad v5.1.2

All the entries in this drop down widget except the last three (User grid, separator, and Edit user grid) are presets. If I use a preset it doesn’t not persist and always reverts to 0.127. If I select User grid, it persists.

Tell me, when you choose a different grid from the presets, does the unsaved content icon highlight?

Ah, OK. With everyone of the preset values the grid is persistent after exiting and reopening KiCad. It doesn’t matter if the project is a different one.

And no, after changing the grid size the save board icon is not highlighted. I mean, without any other change in the layout it stays greyed.

1 Like

Well I suppose I have a bug in my version then, if that’s the way it’s meant to work. But I’m not worked up enough about it. I can live with choosing a User Grid.

What I’d really like to see in a future version is per project or even per PCB grid settings.

I just noticed you wrote you use 5.1.1. That version never got officially released as it includes bugs. Update to 5.1.2.

I already did, see above.

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