Web Viewing of KiCAD Files

You need to set LibName1 as the highest priority library, and shuffle the rest down or remove them. The simple way is:

Leave LibDir blank and put the cache name in LibName1. e.g. for a project called “symgen”

[eeschema]
version=1
LibDir=
[eeschema/libraries]
LibName1=symgen-cache

Note that the path in LibName1 can also be full filesystem path, or relative to any of the library search paths, but always excludes “.lib” extension. KiCad automatically adds the path of the current project and standard KiCad installation libraries to the library search path. (I use Windows but the same principle applies, use forward slash “/” for Unix or Windows)

2 Likes

@bobc That worked great, thanks. I’ll have to figure out how to edit those library entries in the .pro file when it’s uploaded with the rest of the project files. I’ll probably use sed for that task.

We have a standard practice for a guy who starts a design the first thing he does is open a schematic place a symbol and save, so the -cache.lib is created. Then he adds the -cache.lib to the list of used libraries and places it at the top of the list with eeschema. Then the project can be added to the VCS and shared with others.

Once the cache file is listed at the top, are any of the other library entries below it needed anymore? I’m asking because I’m trying to figure out if I can reduce the complexity of having to shift every LibName entry down in the script. If I could just edit the first one and then remove the rest that would make things a little easier, but only makes sense if the other libraries aren’t needed once the cache library has been added at the top.

[eeschema]
version=1
LibDir=
[eeschema/libraries]
LibName1=sample-cache
LibName2=device
LibName3=switches
LibName4=relays
LibName5=power
LibName6=transistors
LibName7=conn
LibName8=linear
LibName9=regul
LibName10=74xx
LibName11=cmos4000
LibName12=adc-dac
LibName13=memory
LibName14=xilinx
LibName15=microcontrollers
LibName16=dsp
LibName17=microchip
LibName18=analog_switches
LibName19=motorola
LibName20=texas
LibName21=intel
LibName22=audio
LibName23=interface
LibName24=digital-audio
LibName25=philips
LibName26=display
LibName27=cypress
LibName28=siliconi
LibName29=opto
LibName30=atmel
LibName31=contrib
LibName32=valves
[general]
version=1

But just for converting the project that the user is feeding to the script, they’re not, correct?

Shifting the libraries down isn’t that complex. Here’s a Perl script that does it:

#!/usr/bin/perl -w

while (<>) {
    s/(LibName)(\d+)/$1 . ($2 + 1)/e;
    print;
}
1 Like

@ppelleti Awesome, thanks!