KiCad BOM Wizard Plugin with customisable output (Can make HTML and CSV BOM)

I think hippo stumbled over the fact that the script without “HTML” or “CSV” as a runtime parameter, does produce html output.
Dunno how much work it would be, if the script could glean from the output file ending what the user want’s - no further need for the extra runtime parameter, that specifies the output type.

Your right. I don’t think that would be hard to do its just the mater of finding time :wink:

I think the docs will need to be updated too. I just noticed that I didn’t mention what the default template is. :frowning:

_ Ron

1 Like

Thank you both for your patience. Everything seems to work now. There are a few crazy English errors in the docs. If you wish I can point them out. They can also sometimes lead to confusion. I am a native English speaker.

@hippo Please do that would be appreciated. There’s only so much that a spellchecker can do for me :smiley:

Hi,

Here are a few corrections:.

KiCad_BOM_Wizard is written in Java Script

The idea for KiCad_BOM_Wizard came from the need to generate BOMs that
are specific to our clients. For example some of our clients require
that their product has document traceability. Uainf KiCad_BOM_Wizard we
simply made a template that includes the document number, …The latter
could be due to needing to include your own…

…KiCad’s plugin manager works by first generating an XML file that
holds all of the project information including…After generation this
file will run a users defined program…

If KiCad_BOM_Wizard finds the short code… it will replace it…

The plugin will group and sort all components together that have the
same parts value…

First you will need to install Node.js and configure it in your system.
If you are using ubuntu you can install it…

…where PATH_TO_NODE is your system’s absolute path to node.

It might be this …

The preferred method is to install KiCad_BOM_Wizard via …

I am also going to assume that you have installed node.js… And
finally, I am also …

In the file explorer file, …

When prompted …

At the Command line: make the following changes

To add the CSV profile follow the HTML instructions but when prompted …

…"%|" is replaced by KiCad with the xml file it generates…

We are assuming…profiles to the KiCad plugin manager. …and revising
comments 1 to 4.

If you are planning on using the file, simply leave its content blank.

30 comments on “KiCad BOM WIzard”

Hopefully this will be helpful.

Greetings,

Daniel Strang

1 Like

Thank you for the feedback. its taken me a little longer than expected but I’ve finally revamp the instructions and updated the video.

_ Ron

Here the updated instructio video. Its shorter and easier to follow :grinning:

_ Ron

2 Likes

Hi, on Ubuntu 16.04lts with Kicad 4.0.6-e0 and following the ‘git clone’ instructions I get:

Command error. Return code 1
Error messages:
/home/anders/KiCad_BOM_Wizard/KiCad_BOM_Wizard.js:51
const { exec } = require(‘child_process’)
^

SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions…js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
at startup (node.js:136:18)
at node.js:966:3

This is with a command line of:

/usr/bin/nodejs “/home/anders/KiCad_BOM_Wizard/KiCad_BOM_Wizard.js” “%I” “%O.html” “HTML”

(usr/bin/node gives the same result).
Any ideas on what is going wrong?
Thanks!

1 Like

Got this working under Windows 10 but I’m having difficulty understanding how to display additional fields. I have the components “Datasheet” field populated in Eeschema but can’t figure out how to modify the template to make it display. Other than that it works great!
-Kevin

Okay, it appears that custom fields will show just fine, however still would like to know if I can display the Datasheet info. Thanks!

Nice, interesting work.

I think PDF will be a good output file extension to add (creating the temporary html and converting). And (maybe not possible, because “%I” is just the BoM) create a document version with Schematic + Components + Silk (assembly PCB diagram).

I’m experiencing the same problem, also running Ubuntu 16.04. I found this fix:

https://www.davidhaillant.com/kicad-bom-wizard-error-on-ubuntu-16-04/

… but this did not work in my system. Wondering if anyone can help Anders_Wallin and me sort this out.

My experience:

Run command:

nodejs “/home/bob/kicad_sources/KiCad_BOM_Wizard/KiCad_BOM_Wizard.js” “/home/bob/Dropbox/Electronics/KicadDesignFiles/ABC/ABC.xml” “/home/bob/Dropbox/Electronics/KicadDesignFiles/ABC/ABC.html” “HTML”

Command error. Return code 1

Error messages:
/home/bob/kicad_sources/KiCad_BOM_Wizard/KiCad_BOM_Wizard.js:51
const { exec } = require(‘child_process’)
^

SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions…js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
at startup (node.js:136:18)
at node.js:966:3

Thanks,

Bob

Hiya @immersitech @Anders_Wallin sorry for the delay reply

Which version of node and npm are you both running? I remember there been an issue a while back with using const {}

Here’s the command to get the version numbers.

node -v && npm -v

I’m curren’tly running v7.9.0 for node and 4.2.0 npm

Hi @KevMonster sorry for the very late reply. If it wasn’t for @immersitech tweet earlier I think it might have been another few more month before I realised I had any pending message on ere :disappointed:

Sorry.

With regard to getting the datasheet field on the BOM. The pluging wasn’t pulling that information. To be honest there are a few other field that I’m not pulling. For example library source and component sheet location.

That said, I’ve updated the plugin and pushed it back to the repository. So if you don’t mind cloning/pulling the update then you should be able to get the datasheet info.

Ron

1 Like

Here’s what I’m running on my system:

$ node -v && npm -v

v4.2.6
3.5.2

I installed these from the Ubuntu 16.04 repositories, so maybe that’s why my versions are earlier than what you have?

Ahh that’s quite old. You will need to install the updated version. Here’s the instruction from node.

You will need to first purge the current version node via sudo apt-get purge node

Ron

That fixed it! The BOM runs just fine now.

~$ node -v && npm -v
v8.4.0
5.3.0

Thank you for the help, Ron!

Bob

For those wanting to use the PDF export function, you no longer need to use the development branch. The code is now live on the master banch and ready to use.

Ron

3 Likes

Yes needs a new layout, will be trying this

First of all thanks for making this plugin available.
Is it possible to have a column separator different from comma?
In Italy we use a comma as decimal separator, as an example 10200 can be written as 10,2 k. At present if I write 10,2 the number will be incorrect in BOM: 10 will be in a column and 2 in the following column.