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.
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.
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.
I think I said this already, but this script is good. Thank you. Too bad my libraries are messy.
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:
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.
Hej @qu1ck,
thanks for your very cool plugin.
Since i track my ECAD projects with gitlab, i like to use IBoM within the Gitlab CI and use it therefore in CLI mode.
You already mention the future request to use ibom.config.ini in CLI, so i wrote a config parser, which ends up in that call:
python ./3rdParty/InteractiveHtmlBom/generate_interactive_bom.py ./my_board.kicad_pcb --dark-mode --highlight-pin1 selected --board-rotation 0 --checkboxes "Sourced,Placed" --bom-view left-right --layer-view F --dest-dir ./artifacts/ibom --name-format ibom --sort-order "C,R,L,D,U,Y,X,F,SW,A,~,HS,CNN,J,P,NT,MH" --blacklist JP* --show-fields "Value,Footprint,MPN,Voltage" --group-fields "Value,Footprint,MPN,Voltage" --dnp-field kicad_dnp --no-browser --extra-data-file ./my_board.kicad_pcb
Now i have to told, that i had some progress to get there.
With my first approach i miss the --extra-data-file
argument. This ends up in an ibom with all parts placed and ignores the “do not place” flags.
I checked, what i did wrong comparing to the plugin UI and realise the extra data file field. So i add this to my CLI call. Now i end up with a very interessting result:
The page loads in Dark Mode, but only the heady with nothing selected and the filter line is visible.
The states shows the correct amount of parts (204, so dnp was recognized), but the (un)grouped BOM is empty. When activate the drawings, no parts are selectable.
I have the same result, if i call generate_interactive_bom.py
with --show-dialog
and configure everything in the same way, as it configured from KiCad Plugin.
I call the python.exe from KiCad.
What do i miss here? what are the differences to the Plugin UI call, beside that the PcbnewParser
get the board from the pcbnew
object in Plugin UI mode, while loads the board in class init when in CLI mode?
One additional note:
It seems that my call will works in Linux (to be specific within the kicad/kicad:9.0 docker image) but not in Windows…
My collegue and i create a little config wrapper for CLI calls:
maybe it will helps somebody
This sounds like maybe there is an error in javascript code which prevents generation of the bom table. Check the browser devtools console for any errors.
Can you share a minimal reproducible example? board file and exact command you use to generate the bom you used.
Possible causes: you are not using kicad’s bundled python or you need to quote the parameters containing asterisk like “JP*”, if you shared more details about exactly how it’s not working (any error messages, etc) I could help more.