Kicad Library Table generator - Page 1
Forum section: electronics / general

author: DJPhil
author_rank: Frequent Contributor
timestamp: January 13, 2014, 05:52:16 pm
content: Hey folks,I know I've been away a long time, but I thought I'd drop this here in case it proves useful to someone.I use Kicad's testing branch and build from it fairly regularly. In the most recent pull I've done they have switched footprint and module management to a Library Table system. This is progress, but it's kind of kludgy at the moment. It uses a file called "fp-lib-table" to store a list of module libraries. There's no automated way to populate the Library Table with entries at the moment.I made a quick and dirty bash script to generate a starter file so folks can get up and running quickly. Rename it with an .sh extension, make it executable with "chmod a+x tablegen.sh", and drop it into a directory full of module libraries. Upon execution it'll generate an fp-lib-table file containing all the .mod files in the directory, which should then be dropped into your home directory (as far as I know).Windows users with some programming savvy should be able to work out an equivalent.I'm no programmer, but maybe this will help folks who would otherwise be brought to a full halt.

author: johansen
author_rank: Super Contributor
timestamp: January 28, 2014, 12:11:56 am
content: correct me if i'm wrong but a recent update auto populates the library table, at least for the included libraries..not your own.

author: firewalker
author_rank: Super Contributor
timestamp: January 28, 2014, 08:11:59 pm
content: Any idea how to add the online *.pretty git repos?Alexander.

author: johansen
author_rank: Super Contributor
timestamp: January 30, 2014, 04:28:09 am
content: Quote from: firewalker on January 28, 2014, 08:11:59 pmGIT Clonehttp://git-scm.com/docs/git-clonein any case, once you download the libraries you have to add them to the kicad library table. which i haven't figured out how to do yet, so i'm waiting for someone else to figure it out, being in the middle of other non electrical projects right now.

author: firewalker
author_rank: Super Contributor
timestamp: January 30, 2014, 06:53:03 am
content: Every component family is a different git repos. Someone must clone ~50 git repos. I read to their email list that there is a way to put the git repository directly to the table and it will fetch it for you. But it doesn;t say how to do so.Alexander.

author: DJPhil
author_rank: Frequent Contributor
timestamp: January 30, 2014, 09:13:37 am
content: I've been super busy with work lately, so I haven't dug back in to KiCad since I posted this.Sounds like you guys are way ahead of me, as I've no idea about repo support. I wish I could be more help.I'll post back here if I make any other related and useful discoveries. I imagine that it'll all get hacked out in short order and will render this thread moot.

author: djsb
author_rank: Super Contributor
timestamp: February 09, 2014, 06:28:46 pm
content: Any chance of a step by step tutorial on how to set the library table up under windows? The linux version does all this automatically and all the github footprints are available. The pcbnew.pdf help document is of little help and very confusing.I've set up the KISYSMOD global path variable pointing it to where my modules/footprints are and I've set up a KIGITHUB global path variable tohttps://github.com/kicad.I don't know how to use the fp-lib-table.for-legacy,fp-lib-table.for-pretty and fp-lib-table.for-github files that I have moved from the templates directory in my kicad installation directory to C:\Documents and Settings\David\Application Data\kicad. Is this directory even my HOME directory?There is NOTHING listed in my PCB library tables dialog. Can ANYONE help me to get this sorted out? Thanks.David.

author: Samah
author_rank: Newbie
timestamp: February 14, 2014, 04:28:32 pm
content: I've copied the fp-lib-table.for-github to "C:\Documents and Settings\MYUSER\Application Data\kicad", and renamed the file to "fp-lib-table" . I have not set up the windows environment variable KGITHUB, please note that it's already set up inside the file "RunKicad.bat":Code:REM Tell PCBNEW where to look on github when using the github footprintREM librariesSET KIGITHUB=https://github.com/KiCadThis way, for me it's working without problem. My Kicad revision is 4695. I hope this can help you a little.Samah

author: Simon
author_rank: Unknown
timestamp: February 15, 2014, 09:04:06 pm
content: aha that seems to work for me now, so what is happening, are the footprints being accessed from the internet now ? does it mean that if they change the online footprints it can screw up a design ?I tried pointing to my old kicad libraries but it would not work.

author: firewalker
author_rank: Super Contributor
timestamp: February 15, 2014, 11:59:28 pm
content: Info: Someone has to enable git module before building, in order to use git repos in fp-table.cmake -DBUILD_GITHUB_PLUGIN=ONAlexander.

author: Samah
author_rank: Newbie
timestamp: February 17, 2014, 09:05:05 am
content: Hi, Simon, if you want to use your local libraries, just copy the same way than before, the file "fp-lib-table.for-legacy" (IMPORTANT: This file contains the references to the NEW libraries, so if you want to use any older one, you have to edit/add lines and change the names at your convenience), and rename it like in my former post (please note that only one "fp-lib-table" file is needed/allowed).Code:(lib (name MY_NAME)(type Legacy)(uri ${KISYSMOD}/MY_LIBRARY.mod)(options "")(descr MY_DESCRIPTION))After that, just don't forget to set the environment variable KISYSMOD, either globally in windows or editing the "RunKicad.bat" and adding this line, but pointing to the folder where your local libraries are.Code:SET KISYSMOD=X:/YOUR/LIBRARIES/FOLDERI think you'll need to restart kicad to make it recognize the changes.If you want to add another library (for example, a customized one) , i think you have to do it "by hand", just editing the file and adding it or through the Preferences menu.It's very important to set up the plugin type to "Legacy" when you add the library, if i leave it in "kicad", it doesn't work for me, i don't know why.And i agree with you, Simon, i'm a little concerned about if they change the footprints without notice and may screw up the designs, i think it's better to download the libraries to the hard disk and use them locally. If i want to update them, i just have to download them again, not so very hard, i think. And of course, this is a lot faster!P.S. Sorry if my english sounds kinda strange, as i'm spanishSamah

author: Simon
author_rank: Unknown
timestamp: February 19, 2014, 10:26:04 am
content: uh I've decided to give diptrace a go, I still think their part selection is a bit shit but it is more stable than kicad and can output 3D models which is a serious advantage when your working in a mechanical engineering company that doesn't understand electronics and it's design data.

author: Frost
author_rank: Regular Contributor
timestamp: February 19, 2014, 06:16:37 pm
content: Quote from: Simon on February 19, 2014, 10:26:04 amThat's the same reason, why I bought a diptrace starter licence last weekDiptrace can read dxf Files for the PCB borders and I hope that I am ableto import my parts as STEP files from the CAD tool with the Diptrace Beta version.Before Diptrace I used Eagle for the PCB layout.

author: Simon
author_rank: Unknown
timestamp: February 19, 2014, 06:21:05 pm
content: yes you can import from STEP files but you need to make sire that all of the axises of your model line up to the axises of the PCB footprint. I tried importing my own very nicely modelled SOIC8 package but it was 90 degrees out and the underside of the package sat on the board instead of the pins.I'm going to try putting my parts into an assembly so that I can orient them in it's axises to agree with the diptrace footprint and then export to step/igs

author: fs
author_rank: Unknown
timestamp: March 13, 2014, 01:59:38 am
content: Quote from: DJPhil on January 13, 2014, 05:52:16 pmThank you.I'm just on my first (gruelling) night trying out KiCad on OSX. I've stumbled into several "packaging / installation" bugs already to do with missing files / config. I'm up-and-running again, but I'm wondering if I too will end up defecting to diptrace (wheres that 'lite' version of Altium???).

author: firewalker
author_rank: Super Contributor
timestamp: June 28, 2014, 10:07:12 am
content: Is there a way to load a specificfp-lib-tablefile during startup (passing argumment, env var etc)? Not the ones located at%APPDATA%\kicad\or~/?Alexander.

author: TaffyDownUnder
author_rank: Newbie
timestamp: July 28, 2014, 11:52:31 am
content: I've started using KiCad again after a year or so away and this time on a Mac. Thanks to this thread I'm making some progress. But I have some questions.I used to keep my modules/libraries separate from the modules/libraries that came with KiCad. With the new fp-lib-table I'm not sure how to do this. Can I edit the fp-lib-table and put in absolute paths to my modules? Or is there a way to add another environment variable (or is there a standard one I should be using) that I can use?Also in the cvpcb the KIGITHUB environment variable doesn't show up; I have used launchctl to set the environment variable. Is there a way to check which flags the OSX version of KiCad I'm using was built with. I got my version from herehttp://www.mdx4.org/the one dated 2014-02-16.Are there any pages I should be looking at about KiCad on OSX.

author: Bassman59
author_rank: Super Contributor
timestamp: August 12, 2014, 08:54:39 pm
content: Quote from: TaffyDownUnder on July 28, 2014, 11:52:31 amYes, you can edit that table, which is what I did before someone on the Kicad mailing list posted a LaunchAgent script which set the relevant environment variables.QuoteI don't use CvPCB, nor do I use the github stuff, but I suspect using a LaunchAgent plist will set it for you.QuoteI honestly don't know, but recent bzr versions of Kicad build fine on OS X 10.9.4.

author: jst
author_rank: Newbie
timestamp: May 28, 2016, 07:17:30 pm
content: Very helpful script!I have edited the script for the new .pretty format.

author: Thor-Arne
author_rank: Unknown
timestamp: May 28, 2016, 07:49:56 pm
content: This thread is old.Current version of KiCad has a Footprint Wizard in pcbnew.

author: timofonic
author_rank: Frequent Contributor
timestamp: May 30, 2016, 10:27:58 pm
content: Nice! Ate there plans to have wizards? Are they going to be coded in Python? What about an extended Lua with Lua Rocks and Luvit?