TL;DR;
Is there a way to create a list of global layer presets that takes effect in all PCB layout files?
I know this topic has been up from time to time, but I couldn’t find the specific answer I was looking for.
I’m using KiCad 7.0.5 on Windows 11, 64 bit. I come from having used Eagle for >10 years and having developed a working method where I rely heavily on showing/hiding certain layers to display the information I want. In Eagle, I solved this by using the command interface, then defining a command to hide/show the layers I want, then register this custom command to a shortcut. Sadly, what I want to see usually don’t coincide with pre-made layer sets. Fortunately, you can configure custom layer presets and cycle through them with ctrl+tab (which is a great feature!).
My main problem is that these custom layer sets seem to be stored as part of the .kicad_pro-file, which means it’s stored only per project. Since I work with many different PCBs together with several colleagues, I would have to create these custom layer sets for every board separately, which means that my preference settings would impact my colleagues.
I would love a feature where KiCad would support some sort of global “layer preset list” that would be automatically loaded when I open any PCB layout.
One critique I’ve seen against such a feature is that “you can define your own layer names”, to which I say that “yes, you can do that, but people will still use the standard names for most boards, so it’s not really a problem, IMO”.
I haven’t found any way to even export layer presets, then importing them. In my opinion, this would be a slightly better solution than what exists today, but still not all the way there.
Since I work with many different PCBs together with several colleagues, I would have to create these custom layer sets for every board separately, which means that my preference settings would impact my colleagues.
We have decided to all use a layer-set which incorporates some presets for my liking and some for the liking of my colleagues. So the layer-preset list is a little bit longer, but it works well enough. Regarding new projects: we base new projects on a older project, so the new project starts with the already available layer presets (and other settings) from the old project.
Otherwise creating the individual presets new for every new board is really …
For New Projects, I suggest creating a Custom Template. A Template can contain All of your desired settings. Here’s a link to an older Tutorial but, is basically still valid.
For Existing Projects, there are a couple of ways to change Selected or All of the files but, given that you may have many files in different locations, it could be a lot of work.
If I needed to do something like 'Changing items, such as layer/other parameters in many files I would do it via Coding a Utility Application. In fact, I just did this last week for fixing All of the my .mod Footprint Files that went south when upgrading Kicad to 7.0.7
For a Coder, it’s quite simple, it amounts to nothing more than doing a Search & Replace and doing it in Python, I used the ‘os.walk’ to walk through the Directory/Folder’s to make Bulk Changes. But, not knowing exactly what item(s) you want to change, I can’t say if doing it will be simple or not… depends.
As an Aid to efficiency, I made it into a Stand-Alone App containing an Editable default Replace String… It will do One String/Text change on All ‘same strings/text’ in Multiple files in the DIR and it’s Sub-Dir’s.
If wanting to change many Different Strings/Texts, just need to embed them into the Code…
. . . which is why I was thinking PlugIn/Script. So a way of defining a few Custom Layer sets and then being able to switch between them with a hotkey.
That’s why I said “But, not knowing exactly what item(s) you want to change, I can’t say if doing it will be simple or not… depends.”
Making the App(your code) into a Plugin can be somewhat equivalent to having a Hot-Key.
Open up a .kicad_pro (or other) file in a TextEditor and identify the desired Items to ‘Search/Replace’. Those could be included (Hard-Coded) so, one-click will change them All in ‘All’ files contained in a Top-Level folder/dir.
Screenshot of section in my Colorizer App shows several (five) items that change upon a Single-Click. So, with correct code, many files with same strings can be changed.
And, if it’s a Stand-Alone-App, no need to even Boot-up Kicad. I made a Plugin to Run the Stand-Alone-App… video below.
It’s important to know what String’s to Search/Replace - knowing this will aid in Not changing items unintentionally. A bad code could destroy a complete file…
This will be True/same for any of the Kicad human-readable-files.
Fortunately, most of the Strings are easy to isolate/Search/Replace because they have Underscores in the Strings. Thus, a Search for ‘blue’ would change all ‘blue’ items. But, a Search for ‘whatever_blue_bicycle’ with a Replace of ‘whatever_yellow_bicycle’ will change only the correct strings.
ADDED: Open a .kicad_pcb and look at all the items you can/want to Search and Replace. This is the File containing PCB stuff. There’s also a Schematic file…
Thinking it may be useful to add… if you’ve created a Custom_Theme, and want to change All of your projects to use it (versus Manually opening and Editing them) you can do that by Search/Replace on All the “page_layout_descr_file”: “” with similar to that shown in the last screenshot…
Screenshot of multiple items being Searched/Replaced via Hard-Coded…