First BOM - is there any default?

I believed/hoped that there will be some default to get BOM (I don’t know Python or XSLT).
Today I tried for the first time. I don’t see any default. Just Tools/Generate Bill of Materials/Generate does nothing (as I understood the xml file is generated but it is not what I wont).

Reading Help at Bill of Material window don’t help me much. I supposed mentioned there faq may be help. There ( https://answers.launchpad.net/kicad/+faq/2265 ) I read: “You are free to use the basic xsltproc stylesheet as is, and this will create a CSV file suitable for loading into a spreadsheet.”
Bingo - so there is some default and it should be what I wont. But what it is “basic xsltproc stylesheet” and how to use it. I understand that xsltproc is a scrypt processor so the stylesheet should be the scrypt file to find. I searched my KiCad installation directory for “stylesheet” and “stylesheet.*” with no results. Where it is?

Till now, as start for my BOM I used generated by Protel text files looking like this:

3 100p C1,C5,C7
2 220p C4,C6
4 100 R1,R2,R3,R4

I think it is the simplest what can be needed. I read them into spreadsheet dividing into columns by text positions, but other methods of dividing I can accept.

What I should do to get BOM file containing at least these information in form possible to read into spreadsheet?
It should’n be complicated but I don’t know how to do it.

My example text file don’t looks like intended.
After counts there are few spaces so values are linked vertically and also references are linked vertically (R1 is exactly under C1).

I would strongly recommend using the “KiBOM” plugin for this, it spits out what your after, I agree it should be baked in better, but this plugin does a very good job of it.

xsltproc is the command line tool the processes xml stylesheets. The default stylesheet that should have been installed with KiCad is bom2csv.xsl. For Windows the command line for running the plugin should look something like:

xsltproc -o “%O” “C:\Program Files\KiCad\bin\scripting\plugins\bom2csv.xsl” “%I”

There are other plugins available, as @Rerouter has just mentioned as I type this.

2 Likes

If you suggest a tool link to the place where one can download it.
I assume with KiBom you mean the bom script by @SchrodingersGat? (Would then be https://github.com/SchrodingersGat/KiBoM)

I personally quite like this one: KiCad BOM Wizard Plugin with customisable output (Can make HTML and CSV BOM)
The files it creates look very nice.

1 Like

So stylesheet is not the name of file. This changes my understanding of it.

Now I know that I should look in KiCad\bin\scripting\plugins but don’t see KiBOM.
I use 4.0.7. May be you write about something added in V5.

A simple CSV BOM file can be created from the board editor: File->Fabrication Outputs->BOM File, at least in v5rc2.

Indeed I was referring to this github archive, its a plugin that is pretty easy to install, I am using it with Kicad 4.0.7

1 Like

I ran into some similar problems in the past. Here is some discussion of that. The trick is to click the “Add Plugin” button.

Also, I found that kifield can be used to generate a BOM, although it is a standalone program, rather than a BOM plugin.

Try putting a line of three backticks (```) both before and after your example text.

3   100p   C1,C5,C7
2   220p   C4,C6
4   100    R1,R2,R3,R4
1 Like

If I get it or that KiBOM will I be able to use it from schematic (by “Add Plugin” button in Bill of Material window)? May be I should try before answering but as I see so fast answer I try to show that I read and try to understand.
At that moment I understand(suppose) that at that window I can load some Plugins. Then probably I select one and press “Generate”. I suppose the field Command line I have to fill also. But I understood that different plugins (Python/XSLT) needs be colled diferently and there is only one line for Command line. So I am probably restricted to have in list only plugins of one type.
Or I have to use plugins you write about from command line?

Both tools have documentation that explains how to use them. I suggest reading it :wink:

Of course if you have questions after reading the docu feel free to come back to us.

Thanks, I’ll read, but I am not sure if I need too sofisticated tool. Starting from text file as I showed I have the rest way ready together with generating the list of ROHS declaration files for each element as new ROHS directive asks manufacturer (in Europe) to have such documentation. I’m not sure if it is time now to move my database to new tools, specially that I plan some Protel->KiCad transfer period when I will be using both (Protel for projects which are just modifications of existing ones).

He means the install of, and yes once installed it shows up when you press the bom button in schematic or pcb,

You would then select the one you want and press “generate”

The default export is already .csv in the exact layout you desire.

There isn’t a default, though. You have to click “Add plugin” and then choose bom_cvs.xsl.

I’m not sure what @Rerouter was saying about. May be about the KiBom default behaviour.

Ok, I need to clarify, For continuity, apparently

I use the KiBOM pluging, as linked above,
After installing it (which is pretty much download - extract then add as a plugin in that menu)

KiBOM will be in the list. click to select it, hit generate, and out of the box it will spit out a csv in the format he desires.

Sorry, I misunderstood your original statement. Now I see what you meant.

That clarifies me also one thing - I supposed you are writeing about may be some external applications (to install separatelly from KiCad and use separatelly). I still don’t know how such plugin can have different outputs (don’t know how you select your output), but suppose instruction will tell me everything.

Thanks to all of you who tried to help me. Unfortunatelly courier bring a parcel with something which I have to work immedietelly (something which should work but don’t). And on Monday I will probably get prototypes of antennas to work with them (we got into reading distance problems when swithced from standard mifare to crypto mifare PLUS tags). So don’t know when I’ll get back to BOM subject.

I use V4.0.7 on Linux Mint, and on my PC I first thought that the BOM tool was “too complicated” to be worth looking into, and I just closed the window when presented with an empty selelction list.
After toying around with it for a few minutes, I discovered however that a bunch of scripts for generating a BOM are installed, but not in the place KiCad expects them to.
You can try pointing the bom tool to your local equivalent of:

/usr/lib/kicad/plugins/README-bom.txt
/usr/lib/kicad/plugins/bom2csv.xsl
/usr/lib/kicad/plugins/bom2grouped_csv.xsl
/usr/lib/kicad/plugins/bom_csv_grouped_by_value.py
/usr/lib/kicad/plugins/bom_csv_grouped_by_value_with_fp.py
/usr/lib/kicad/plugins/bom_csv_sorted_by_ref.py
/usr/lib/kicad/plugins/bom_html_grouped_by_value.py
/usr/lib/kicad/plugins/bom_html_with_advanced_grouping.py
/usr/lib/kicad/plugins/bom_sorted_by_ref.py
/usr/lib/kicad/plugins/bom_with_title_block_2_csv.xsl

Weird though:
I forgot where the dialog is for pointing PCBnew to those scripts.
Then I accidentally stumbled upon:
PCBnew -> File -> Fabrication Outputs -> BOM file -> Save
That generated a csv file with semicolons (much more sensible than commas) which I could import into libreoffice Calc without any problem.

1 Like