Where are templates for default KiCad project in 5.99?

I want to alter the defaults for the every new project I create. I don’t want to create my own template, I want to alter defaults for projects created with no template. Where can I do that? Earlier it was /usr/share/kicad/templates/kicad.pro but my current 5.99 build does not seem to use this file for new projects.

The nightlies have been completely separated from the stable version. It also has it’s own libraries etc.

So try:

/usr/share/kicad-nightly/blablabla

you can also put a file kicad.kicad_pro in ~/.local/share/kicad/5.99/template and it should work

EDIT: there was a bug with this that made it not work, but it should work tomorrow :slight_smile:

Thanks, just recompiled KiCad and tried it. ~/.local/share/kicad/5.99/template does not work, but ~/.config/kicad/5.99/template does. Is this normal or should be reported as a bug?

Also, it seems KiCad picks up just settings in .kicad_pro file. I have tried putting kicad.kicad_pcb to the said directory, but the board stackup is not being picked up. Is there a way to replicate the default stackup?

ok, this might be related to a fact that my KICAD_USER_TEMPLATE_DIR is set to this directory.

Still I’d like KiCad to pull in default stackup.

Sorry for the noise, I have had a look into kicad_manager_frame.cpp and I can see that only kicad.kicad_pro is being copied, schematics and pcb files are seeded with minimal sexpr.

I think I could tackle this if it’s something we want for v6, what do you think @craftyjon?

I have never given much attention about how new projects are started because I do not make enough KiCad projects to bother but it does appear some settings for new projects are hard coded, such as the paper size.

Having a (configurable) default template for empty projects does seem a logical improvement.

Then there are also some other settings, such as grid size, which are apparently system wide and not stored in each project. I’m not entirely sure what’s happening here. I run the stable and the nightlies for about the same amount of time and I have some difficulty what is actually happening.

Since this would be a new feature, please open an issue for it and then say you’d like to work on it, we’ll have to check in with Wayne at least to see if it can be done for V6.

If you do open an issue, pase a link to it here.

For me personally this would open two different ways of achieving a same result. You can make a user template with empty but configured schematics and empty but configured layout. I’d rather have an option within KiCad to choose a default template instead of adding another location for default template. But maybe I misunderstood you approach.

A user template is one that shows up in the New from Template workflow, and already lets you add default files. The fallback template is what we’re discussing here – it is always called kicad.kicad_pro and right now only lets you customize the project file, not the starting board or schematic file.

1 Like

Yeah, I was probably not clear enough. If implementing the solution for this, I’d make an option to select one of the user or system templates to act as a fallback template.

I can solve this in two ways:

  • have a template called ‘default’ that is used for project creation by default. ‘default’ template in user template directory overrides the one in system directory. If there is no default template, then we fallback to verbatim creation of minimal file stubs as it is done now for kicad_pcb and kicad_sch files and also for kicad_pro file when kicad.kicad_pro is not available.
  • another solution that would have the least amount of code change is just to add code to copy over kicad.kicad_pcb and kicad.kicad_sch files like it’s done for kicad.kicadp_pro file now.

Code for making a project from a template already exists.

For me the cleanest way would be to ensure there is always at least one default project template (In the system directory, in-accessible to normal users) and then completely remove the generation from “minimal file stubs”

I do not believe in:

“Minimum code change” is a hackish way of doing this. When updating code, a bit of refactoring should always be considered. If you let the crud accumulate (over years) then it results in an unmanageable mess. (The crud grows exponentially).

By always starting projects from a template, (minimal code change in itself) all the crud of ad-hoc creating a project stub can be removed from KiCad (Big refactoring gain)!

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