Interactive Html Bom Plugin for KiCad

Thanks @qu1ck
Do you have an example of this shell script?

Something along the lines of

#!/bin/bash

/path/to/generate_interactive_bom.py --your-flags-here "$@"

Pass file name to it like my_ibom_wrapper.sh /path/to/board.kicad_pcb and it will automatically pass the flags along with the file to ibom.

OK. Thank you.
I was actually thinking of the script to convert the .ini file in a list of flags for the CLI.

You could write a little program for that but you shouldn’t have to unless you have lots of options that are not default. You only have to specify flags that you changed.

Indeed, thanks a lot.

Is it possible to use IBOM (or the data in the html file) to create a placement (CPL) file? I have an IBOM and I’d like to generate files for JLPCB assembly.

Yes, but with a bunch of caveats. There is layer, position, angle info in the data, look at the format. You could extract it from the html file directly and decompress the pcbdata struct or you can manually copy from browser dev tools (pcbdata variable in global namespace will be already unpacked).

But you need to take care about what you include in your cpl file (most manufacturers want smt footpritns only or at least separate, ibom does not care about smt/smd distinction) what coordinates offset should you use.

And most importantly you need to make sure it was generated from kicad project, not from something else because I can only guarantee that bounding box center and angle is correct in case of kicad, not other tools. Even then, rotation angle of the footprint is not always the same as rotation from the reel that cpl files are expected to have but that is not specific to kicad or ibom.

1 Like

I thought this was a built in feature, but apparently not.
This script is good. How can I add columns, my version has only basics, and not for instance Manufacturer, Manufacturers code and so on.

I have not read all 387 messages, and I probably wont.

Add your fields in eeschema and update pcb. Then those fields will appear in extra fields list in ibom config window.

1 Like

I think I said this already, but this script is good. Thank you. Too bad my libraries are messy.

1 Like

Version 2.10.0 is released and available in the KiCad’s plugin manager and from pypi.

This release contains many general fixes, compatibility fixes for KiCad 9 and a couple new features:

  • Padstack support for KiCad 9
  • Via support for EasyEDA
  • Html setting to highlight rows on mouse click instead of hover
7 Likes

I just try to run the generate_interactive_bom.py from iBOM 2.10.0 as in Jobsets: Execute Command (iBom?) - #6 by hildogjr but I getting the bellow error on KiCad 9.0.0-rc3-5ca7abf2c1~182~ubuntu24.04.1 version

...
eractiveHtmlBom/ecad/kicad.py", line 4, in <module>
    import pcbnew
ModuleNotFoundError: No module named 'pcbnew'

Maybe the pcbnew was already removed from KiCad distribution? Someone having the same behavior?

It is not removed, old python api is still there.
You probably have some other python on system path and kicad is picking that. Try giving full path to kicad’s own python. I’m assuming you are on windows here.

It is true! You are right.

pcbnew package is not visible on system Python but is on Pcbnew console. So it is under some environment.

Tracking my debugging step: on Linux, the launch file (“shortcut”) have the content like

#!/bin/sh
. /usr/share/kicad-nightly/kicad-nightly.env
 /usr/lib/kicad-nightly/bin/kicad "$@"

The `` file

export LD_LIBRARY_PATH=/usr/lib/kicad-nightly/lib/x86_64-linux-gnu/:/usr/lib/kicad-nightly/lib/
export KICAD_PATH=/usr/share/kicad-nightly

And inside ${LD_LIBRARY_PATH}/python3/dist-packages there are the pcbnew.py and _pcbnew.so (compiled) files.

Just checking how to create a “clean command” do include such information on “Execute Command Job Settings” for Jobsets: Execute Command (iBom?) - #6 by hildogjr.

You probably should create a wrapper shell script to launch python with PYTHON_PATH variable set to .../python3/dist-packages of the nightly kicad. Use that shell script instead of python in your jobset command.

Is there a way to save different PCBA configuration settings for iBoM? I can see a field named “Board Variant”. Can someone explain how to use that field?

I suspect, but not 100% sure, that it’s to do with KiBot . . .

  • variant : [string=’’] Board variant to apply. Avoid using it in conjunction with IBoM native filtering options.
  • variant_field : [string=’’] Name of the extra field that stores board variant for component. IBoM option, avoid using in conjunction with KiBot variants/filters.
  • variants_blacklist : [string=’’] List of board variants to exclude from the BOM. IBoM option, avoid using in conjunction with KiBot variants/filters.
  • variants_whitelist : [string=’’] List of board variants to include in the BOM. IBoM option, avoid using in conjunction with KiBot variants/filters.

KiBot just re exports those options, they are native to ibom.

To use board variants you have to define a custom field and then use blacklist/whitelist to control what gets into the bom based on value of the field. If whitelist is set then only components with chosen field value that is on the whitelist will be in the bom. If blacklist is enabled then only components that are NOT on the blacklist will be in the bom. For components that don’t have the field set (or it is empty string) use <empty> option.
Blacklist/whitelist fields in ibom gui will populate once you choose the variant field and you have some components with varying field values.

2 Likes