Where to put new .Lib and .Mod files

I have a new connector symbol or component from Net. Can I just put the Mod-file into project CM4IO.pretty folder. But where I should put Lib file.
Is that all, files have generic names not related to component name.

You can use whatever directory structure in your project you want. Different people do it differently, but I usually just put the .lib and .dcm files at the top-level of the project directory. For example:

Palette
β”œβ”€β”€ avr-arduino.dcm
β”œβ”€β”€ avr-arduino.lib
β”œβ”€β”€ digikey-footprints.pretty
β”‚   β”œβ”€β”€ Battery_Holder_Coin_2032_BS-7.kicad_mod
β”‚   └── Switch_Slide_JS202011SCQN.kicad_mod
β”œβ”€β”€ dk_Battery-Holders-Clips-Contacts.dcm
β”œβ”€β”€ dk_Battery-Holders-Clips-Contacts.lib
β”œβ”€β”€ dk_Slide-Switches.dcm
β”œβ”€β”€ dk_Slide-Switches.lib
β”œβ”€β”€ fp-info-cache
β”œβ”€β”€ fp-lib-table
β”œβ”€β”€ local.dcm
β”œβ”€β”€ local.lib
β”œβ”€β”€ local.pretty
β”‚   β”œβ”€β”€ IDC-Header_FTSH_2x05_P1.27mm_Vertical_SMT.kicad_mod
β”‚   β”œβ”€β”€ Mitsumi_SOU-24xHNT.kicad_mod
β”‚   └── SLR0283Dxxxxx.kicad_mod
β”œβ”€β”€ Palette-cache.lib
β”œβ”€β”€ Palette.kicad_pcb
β”œβ”€β”€ Palette.kicad_pcb-bak
β”œβ”€β”€ Palette.pro
β”œβ”€β”€ Palette.sch
β”œβ”€β”€ Palette.sch-bak
└── sym-lib-table

The important thing is that you have to specify your .pretty directories in the fp-lib-table, and your .lib files in the sym-lib-table. Your can do this from the KiCad GUI, but the files will end up looking something like this:


sym-lib-table

(sym_lib_table
  (lib (name avr-arduino)(type Legacy)(uri ${KIPRJMOD}/avr-arduino.lib)(options "")(descr "AVR microcontrollers with Arduino pin numbers"))
  (lib (name dk_Battery-Holders-Clips-Contacts)(type Legacy)(uri ${KIPRJMOD}/dk_Battery-Holders-Clips-Contacts.lib)(options "")(descr "battery holders, clips, contacts"))
  (lib (name dk_Slide-Switches)(type Legacy)(uri ${KIPRJMOD}/dk_Slide-Switches.lib)(options "")(descr "slide switches"))
  (lib (name local)(type Legacy)(uri ${KIPRJMOD}/local.lib)(options "")(descr "local symbols"))
)

fp-lib-table

(fp_lib_table
  (lib (name digikey-footprints)(type KiCad)(uri ${KIPRJMOD}/digikey-footprints.pretty)(options "")(descr "Digi-Key footprints"))
  (lib (name local)(type KiCad)(uri ${KIPRJMOD}/local.pretty)(options "")(descr "local footprints"))
)

The important part is that ${KIPRJMOD} is the project directory, so you want to make your paths relative to that.

I use only global libraries (not related to any project) as I assume any symbol and footprint I define may be I’ll use in some other design.
In My KiCad working directory I have directories: _PcbLib and _SchLib and I put my libraries there.

For project specific libraries, I usually put the schematic symbol library in the same directory as the footprints.

I don’t use any global libraries, except for the KiCad standard libraries. Everything else gets copied into the project. I post my projects on GitHub, and I like them to be self-contained.

Thank you for all of you.
Does it matter that one file is SFW15R-2STE1LF.kicad_mod and the other 2021-12-01_17-44-51.lib. The lib-file name is just a date.

KiCad doesn’t care, I think. But for you if you will be searching for something it will be much easier if name will be descriptive. Specially if you will be doing it few years later and have many such files named by some past dates.

Can I just change lib-file name to something sensible, can it be so simple.

I am surprised with that question. I just decided how my libraries will be named and gave them my names. I’m not sure if it is just changing the lib file name. I have done that long time ago (with 4.0.7). But for footprint library it is just changing the directory name (of course you have to update your library list).
Some of my lib files are: C.lib (capacitors), D.lib (diodes), L.lib, R.lib, T.lib (transistors), LED.lib, Hole.lib, …
All my footprint directories are single letter names. Some of them: C.pretty, D.pretty, L.pretty, R.pretty, T.pretty, U.pretty (from Polish name for ICs), X.pretty (quartz), …

Yes, you can just rename the .lib file. (And if there is a corresponding .dcm file, rename it as well.)

It doesn’t matter what the file is called, as long as it is listed in your sym-lib-table file.

The file or component is now in the project specific components. I put the folder in two places, in C:\Program Files\KiCad\6.0\share\kicad\footprints and in C:\Users\LM10_64\Documents\KiCad\6.0\local.pretty and I am not sure what made it. Suddenly there were no errors, until I tried to update the PCB.

The layout part does not find the footprint: β€œError: Cannot add J6 (footprint β€˜CON15_1X15_DRB_SFW_JAE’ not found).”. There are SFW15R-2STE1LF.kicad_mod, SFW15R-2STE1LF.kicad_sym and SFW15R-2STE1LF.lib files in both directories.

But it sounds like you don’t have a CON15_1X15_DRB_SFW_JAE.kicad_mod file, which is what it’s looking for.

Do a search for my user name and cross platform, or something similar. I remember the pains that I had, but I’ve moved onto bigger pains.

Also, provide some screenshots if you want more help from me.

That made it. Thanks
I renamed the mod-file.
And now I have edit the footprint
For Sprig: Thank, yes in my former CAD creating new parts was also a pain/difficult.

And it works? Where do project files go?

I love this, I can’t fix the symbol, because it is read only.

Well, it DID.

On the stick!

But the stick should have a local folder on both machines that are synced.

1 Like

I’ll take a break. 20 characters minimum