How It Works

Just in case you don't know, KiCad's plugin manager works by first generating an XML file that holds all of the project information include the list of parts you are using. After it generates this file, it will run a user define program with the XML file as an input parameter with any other user define parameters.

KiCad_BOM_Wizard works by scanning through all of the template files ( here's the list ) and replacing any of the Short Codes with the data that is associated with it. It will then output all of the data into one file based on the order that it finds the short codes.

For example, if KiCad_BOM_Wizard finds the short code <!--TAG_TITLE--> in template.conf then it we replace it with the project title as set in the KiCad root document.

The plugin will group and sort all components together that have same parts value, the same starting designator reference prefix and the same fields value.

For example, if your project component list consist of;

R1 10K, R2 100K, C1 10pF and R3 10K

then it would be grouped like this;

ref qty value
C1 1 10pF
R1 R3 2 10K
R2 1 100K

Project Repository

https://github.com/HashDefineElectronics/KiCad_BOM_Wizard.git

KiCad.Info Forum Post

https://forum.kicad.info/t/kicad-bom-wizard-plugin-with-customisable-output-can-make-html-and-csv-bom/2142

Installing Node.Js

First you will need Node.js install and configure in you system. if you are using ubuntu then you can installing it by running the following commands.

sudo apt-get install nodejs sudo apt-get install npm

If you are using windows or a mac you can follow this link to download node.js installer.

https://nodejs.org/en/download/

MAC OSX Note!

there have been reports that `node` wont run in KiCad BOM generator unless its full path has been specified.

If you have this issues, try replacing `node` with `PATH_TO_NODE/node` where PATH_TO_NODE is your system absolute path to node.

Here's where it was first repoted: kiCad.info

Download and isntall KiCad_BOM_Wizard

Video Instructions

https://youtu.be/k9EE21K-m8M

___

Installation

nodeJs

The following serves as a quick reference.

Debian/Ubuntu Linux:

sudo apt-get install nodejs npm

Mac OSX using Homebrew:

brew install node

Installing nodejs on other systems:

[NodeJS.org](https://nodejs.org/en/download/)

Installation KiCad_BOM_Wizard via npm (prefer method)

npm install -g --production kicad_bom_wizard

Installation KiCad_BOM_Wizard via github download

This assumes that you have downloaded the project's 'ZIP' file from github. (ie, you now have `KiCad_BOM_Wizard-master.zip`)

unzip KiCad_BOM_Wizard-master.zip -d KiCad_BOM_Wizard-master

cd KiCad_BOM_Wizard-master

npm install -g --production kicad_bom_wizard

Installation KiCad_BOM_Wizard via git clone

git clone https://github.com/HashDefineElectronics/KiCad_BOM_Wizard.git

cd KiCad_BOM_Wizard

npm install -g --production kicad_bom_wizard

Video Instructions

Writting Instructions

You will need to open an existing project schematic using KiCad Eeschema. For this example I am going to use KiCad complex_hearachy project example and setup KiCad_BOM_Wizard to generate the HTML and CSV BOM. I am also going to assume that you have the install node.js and proven that it works. And finally, I also going to assume that you have a copy of the KiCad_BOM_Wizard in your computer root directory.

Hash Define Electronics KiCad complex_hierarchy KiCad_BOM_Wizard Eeschema

Adding HTML Profile

In Eeschema, Click the BOM icon. this should bring up the following window.

Hash Define Electronics KiCad complex_hierarchy KiCad_BOM_Wizard Eeschema BOM Manager

Now click on the "Add Plugin" button. On the file explorer file, find and open "KiCad_BOM_Wizard.js".

Hash Define Electronics KiCad complex_hierarchy KiCad_BOM_Wizard Eeschema BOM Manager file exploere

When prompt for the Plugin name, type in BOM_HTML and click OK.

Hash Define Electronics KiCad complex_hierarchy KiCad_BOM_Wizard Eeschema BOM Manager plugin name

So far the new plugin profile should look like this. Its not ready, we still need to add the extra parameters to make it work.

Hash Define Electronics KiCad complex_hierarchy KiCad_BOM_Wizard Eeschema BOM Manager with plugin partial

Under Command line: change it to the following.

node "SCRIPT_ROOT_DIR/KiCad_BOM_Wizard.js" "%I" "%O.html"

SCRIPT_ROOT_DIR is the directory path to where your KiCad_BOM_Wizard.js is located, "%I" is replace by kicad with the xml file it generate and "%O" is also replaced by KiCad with the output directory and name.

Hash Define Electronics KiCad complex_hierarchy KiCad_BOM_Wizard Eeschema BOM Manager with plugin HTML

Adding CSV Profile

To add the CSV profile repeat the HTML instructions but when prompt for the plugin name type BOM_CSV and change the Command Line: to the following.

node "SCRIPT_ROOT_DIR/KiCad_BOM_Wizard.js" "%I" "%O.csv" "SCRIPT_ROOT_DIR/Template/CSV"

SCRIPT_ROOT_DIR is the directory path to where your KiCad_BOM_Wizard.js is located, "%I" is replace by kicad with the xml file it generate and "%O" is also replaced by KiCad with the output directory and name.

Hash Define Electronics KiCad complex_hierarchy KiCad_BOM_Wizard Eeschema BOM Manager with plugin CSV

Adding Custom Profile

To add the CSV profile repeat the HTML instructions but when prompt for the plugin name type in your own name and change the Command Line: to the following.

node "SCRIPT_ROOT_DIR/KiCad_BOM_Wizard.js" "%I" "%O.MY_FILE_EXT" "YOUR_TEMPLATE"

SCRIPT_ROOT_DIR is the directory path to where your KiCad_BOM_Wizard.js is located, YOUR_TEMPLATE is the directory path to your own template folder, MY_FILE_EXT is the file extension you want your output file to use, "%I" is replace by kicad with the xml file it generate and "%O" is also replaced by KiCad with the output directory and name.

Hash Define Electronics KiCad complex_hierarchy KiCad_BOM_Wizard Eeschema BOM Manager with plugin ATEX

Generating The BOM

We are assuming that you have already added the BOM_HTML profiles to KiCad plugin manager. We are also assuming that you have set the project sheet, date, company, revising and Comment 1 to 4.

Click the BOM icon in Eeschema. this should bring up the following window with the profile you have added.

Hash Define Electronics KiCad complex_hierarchy KiCad_BOM_Wizard Eeschema BOM Manager with plugin ALL

Now select the BOM_HTML profile and click on the Generate button. When KiCad is done, it should show a Success message under the Plugin Info:.

Hash Define Electronics KiCad complex_hierarchy KiCad_BOM_Wizard Eeschema BOM Manager with plugin ALL Success

If you go back to the KiCad Project Manager, you should now see the new HTML file that has been added to your project.

Hash Define Electronics KiCad complex_hierarchy KiCad_BOM_Wizard KiCad project Manager HTML

If you open the new html file you should get something like this.

Hash Define Electronics KiCad BOM wizard generator

Information For Making Your Own Template

KiCad_BOM_Wizard.js requires a specific set of files that allow it to successfully generate your BOM file. In this section, I will explain what files you need, how KiCad_BOM_Wizard uses them and which short code you can use in them.

The best way to start making your own template is by copying an existing one. The HTML and CSV templates that that come with KiCad_BOM_Wizard should be a good starting point. The following section should help in clarifying what each of the files and short codes do.

File Structure

Here is a list of all the files that a template needs. If you are planning on using the file, simple leave its content blank.

[table width="100%" colwidth="40%|60%" ]

File name/Description

template.conf/Main root

headers.conf/The header configuration file is used to create the table headers. It should describe how a single header column should look like.

group.conf/The group configuration file is used by KiCad_BOM_Wizard to generate a group of parts table data.

row.conf/The row configuration file describes the row first four columns order and style. The columns are components designator, quantity, part value and fields. This is used by the group.conf.

fields.conf/fields configuration file is used by KiCad_BOM_Wizard to generate the fields columns. If you want to generate a BOM without fields then you can simple leave this file blank.

[/table]

Files Calling Graph

Cad_BOM_Wizard Calling Graph Rev_0

Short Codes

This are the lists of short codes that each of the files support.

[table caption="for template.conf" colwidth="40%|60%"]

Code/Description

<!--TITLE-->/inserts the root sheet title.

<!--DATE-->/inserts the root sheet date.

<!--DATE_GENERATED-->/inserts the date and time the Kicad net file was created

<!--COMPANY-->/inserts the root sheet company name

<!--REVISON-->/inserts the root sheet revision value

<!--COMMENT_1-->/inserts the root sheet comment 1

<!--COMMENT_2-->/inserts the root sheet comment 2

<!--COMMENT_3-->/inserts the root sheet comment 3

<!--COMMENT_4-->/inserts the root sheet comment 4

<!--TOTAL_NUM_OF_PARTS-->/inserts the number of parts used in the design

<!--TOTAL_NUM_OF_UNIQUE_PARTS-->/inserts the number of unique parts used in the design. Note, if two similar parts have different fields then it will be register as unique

<!--CLASS_HEADER_TAG-->/inserts the table headers

<!--BOM_TABLE-->/inserts the complete generated BOM table

[/table]

[table caption="for headers.conf" width="100%" colwidth="40%|60%"]

Code/Description

<!--HEADER_ROW-->/inserts the column title

<!--HEADER_CLASS_REF_TAG-->/insert the tag for the part reference. HeadRefTag

<!--HEADER_CLASS_QTY_TAG-->/insert the tag for the part qty. HeadQtyTag

<!--HEADER_CLASS_VALUE_TAG-->/insert the tag for the part value. HeadValueTag

[/table]

[table caption="for group.conf" width="100%" colwidth="40%|60%"]

Code/Description

<!--GROUP_ROW_DATA-->/inserts the group of parts row data

<!--GROUP_CLASS_TAG-->/inserts the group class name. format "group_" + "part ref prefix"

<!--GROUP_TITLE_TEXT-->/inserts the group title. the part ref prefix

[/table]

[table caption="for row.conf" width="100%" colwidth="40%|60%"]

Code/Description

<!--ROW_PART_REF-->/inserts the list of parts reference designator

<!--ROW_PART_QTY-->/inserts the number of parts grouped together

<!--ROW_PART_VALUE-->/inserts the part value

<!--ROW_PART_FIELDS-->/inserts the generator parts fields

<!--ROW_CLASS_ODD_EVEN_TAG-->/returns RowEvenTag on even rows or RowOddTag for odds rows.

<!--HEADER_CLASS_REF_TAG-->/insert the tag for the part reference. HeadRefTag

<!--HEADER_CLASS_QTY_TAG-->/insert the tag for the part qty. HeadQtyTag

<!--HEADER_CLASS_VALUE_TAG-->/insert the tag for the part value. HeadValueTag

[/table]

[table caption="for fields.conf" width="100%" colwidth="40%|60%" ]

Code/Description

<!--FIELD_CLASS_TAG-->/inserts the fields class name

<!--FIELD-->/inserts the field value

[/table]