### Full Help Output Example
Source: https://github.com/openscopeproject/interactivehtmlbom/wiki/Usage
This is a comprehensive example of the output generated by running the script with the `--help` flag, detailing all available positional and optional arguments.
```text
usage: generate_interactive_bom.py [-h] [--show-dialog] [--version] [--dark-mode]
[--hide-pads] [--show-fabrication]
[--hide-silkscreen]
[--highlight-pin1 [{none,all,selected}]]
[--no-redraw-on-drag]
[--board-rotation BOARD_ROTATION]
[--offset-back-rotation] [--checkboxes CHECKBOXES]
[--bom-view {bom-only,left-right,top-bottom}]
[--layer-view {F,FB,B}] [--no-compression]
[--no-browser] [--dest-dir DEST_DIR]
[--name-format NAME_FORMAT] [--include-tracks]
[--include-nets] [--sort-order SORT_ORDER]
[--blacklist BLACKLIST] [--no-blacklist-virtual]
[--blacklist-empty-val]
[--netlist-file NETLIST_FILE]
[--extra-data-file EXTRA_DATA_FILE]
[--extra-fields EXTRA_FIELDS]
[--show-fields SHOW_FIELDS]
[--group-fields GROUP_FIELDS]
[--normalize-field-case]
[--variant-field VARIANT_FIELD]
[--variants-whitelist VARIANTS_WHITELIST]
[--variants-blacklist VARIANTS_BLACKLIST]
[--dnp-field DNP_FIELD]
file
KiCad InteractiveHtmlBom plugin CLI.
positional arguments:
file KiCad PCB file
optional arguments:
-h, --help show this help message and exit
--show-dialog Shows config dialog. All other flags will be ignored.
(default: False)
--version show program's version number and exit
--dark-mode Default to dark mode. (default: False)
--hide-pads Hide footprint pads by default. (default: False)
--show-fabrication Show fabrication layer by default. (default: False)
--hide-silkscreen Hide silkscreen by default. (default: False)
--highlight-pin1 [{none,all,selected}]
Highlight first pin. (default: none)
--no-redraw-on-drag Do not redraw pcb on drag by default. (default: False)
--board-rotation BOARD_ROTATION
Board rotation in degrees (-180 to 180). Will be rounded to
multiple of 5. (default: 0)
--offset-back-rotation
Offset the back of the pcb by 180 degrees (default: False)
--checkboxes CHECKBOXES
Comma separated list of checkbox columns. (default:
Sourced,Placed)
--bom-view {bom-only,left-right,top-bottom}
Default BOM view. (default: left-right)
--layer-view {F,FB,B}
Default layer view. (default: FB)
--no-compression Disable compression of pcb data. (default: False)
--no-browser Do not launch browser. (default: False)
--dest-dir DEST_DIR Destination directory for bom file relative to pcb file
directory. (default: bom/)
--name-format NAME_FORMAT
Output file name format supports substitutions: %f : original
pcb file name without extension. %p : pcb/project title from
pcb metadata. %c : company from pcb metadata. %r : revision
from pcb metadata. %d : pcb date from metadata if available,
file modification date otherwise. %D : bom generation date. %T
: bom generation time. Extension .html will be added
automatically. (default: ibom)
--include-tracks Include track/zone information in output. F.Cu and B.Cu layers
only. (default: False)
--include-nets Include netlist information in output. (default: False)
--sort-order SORT_ORDER
```
--------------------------------
### Install Eagle/Fusion360 Dependencies
Source: https://github.com/openscopeproject/interactivehtmlbom/wiki/Usage
Install the necessary Python libraries, wxPython and jsonschema, for processing Eagle and Fusion360 board files.
```shell
pip install wxpython jsonschema
```
--------------------------------
### Install InteractiveHtmlBom via Pip
Source: https://github.com/openscopeproject/interactivehtmlbom/wiki/Installation
Use this command to install the plugin from PyPI. For Linux users, the `--user` flag is recommended to avoid modifying system libraries.
```bash
python -m pip install InteractiveHtmlBom
```
--------------------------------
### Install wxPython Dependency
Source: https://github.com/openscopeproject/interactivehtmlbom/wiki/Usage
Install the wxPython library using pip. This is a prerequisite for running the script with certain EDA tools like EasyEDA, Eagle, Fusion360, and Allegro.
```shell
pip install wxpython
```
--------------------------------
### Create Symlink on Windows
Source: https://github.com/openscopeproject/interactivehtmlbom/wiki/Installation
Use this command in the Windows command prompt to create a symbolic link for manual plugin installation.
```cmd
cmd /c mklink /D
```
--------------------------------
### Create Symlink on Linux/MacOS
Source: https://github.com/openscopeproject/interactivehtmlbom/wiki/Installation
Use this command to create a symbolic link for manual plugin installation on Linux and MacOS systems.
```bash
ln -s
```
--------------------------------
### GitLab CI Configuration with Xvfb
Source: https://github.com/openscopeproject/interactivehtmlbom/wiki/Tips-and-Tricks
This GitLab CI configuration demonstrates how to set up a Ubuntu 16.04 environment, install Kicad and InteractiveHtmlBom, and run the BOM generation process using `xvfb-run` to provide a virtual X server.
```yaml
image: ubuntu:16.04
#Will save to https://.gitlab.io//ibom.html
pages:
script:
#PCB path name relative to the root of the repository
- PCBPATH="pcb/pcb.kicad_pcb"
- ARGS="--layer-view F"
- apt-get update -qq && apt-get install -y software-properties-common xvfb git
- add-apt-repository ppa:js-reynaud/kicad-5
- apt-get update -qq && apt-get install -y --no-install-recommends kicad
- git clone https://github.com/openscopeproject/InteractiveHtmlBom.git
- mkdir public
- CURRENTDIR=$(pwd)
- xvfb-run --auto-servernum --server-args "-screen 0 1024x768x24" python2 InteractiveHtmlBom/InteractiveHtmlBom/generate_interactive_bom.py --no-browser $ARGS $PCBPATH --dest-dir $CURRENTDIR/public
artifacts:
paths:
- public
only:
- master
```
--------------------------------
### Generate BOM from Eagle/Fusion360 Project
Source: https://github.com/openscopeproject/interactivehtmlbom/wiki/Usage
Process Eagle or Fusion360 board files directly with the standalone script. Ensure wxPython and jsonschema are installed beforehand.
```shell
python .../generate_interactive_bom.py .../board.brd
```
--------------------------------
### Find KiCad Plugin Directories
Source: https://github.com/openscopeproject/interactivehtmlbom/wiki/Installation
Run this Python script in KiCad's scripting console to get a list of directories where Pcbnew searches for plugins.
```python
import pcbnew
print(pcbnew.PLUGIN_DIRECTORIES_SEARCH)
```
--------------------------------
### Run Interactive HTML BOM from Repository
Source: https://github.com/openscopeproject/interactivehtmlbom/wiki/Usage
Invoke the Interactive HTML BOM script directly from its repository location using a Python interpreter. This method is an alternative to installing via pip.
```shell
python path/to/InteractiveHtmlBom/generate_interactive_bom.py ...
```
--------------------------------
### Run Interactive HTML BOM as Standalone Script (Linux)
Source: https://github.com/openscopeproject/interactivehtmlbom/wiki/Usage
Execute the Interactive HTML BOM script directly from the terminal on Linux systems. Ensure the script is installed via pip.
```shell
generate_interactive_bom path/to/board.kicad_pcb
```
--------------------------------
### Drawing Bezier Curve Structure
Source: https://github.com/openscopeproject/interactivehtmlbom/blob/master/DATAFORMAT.md
Represents a Bezier curve drawing on the PCB. Includes start, end, control points, and width.
```javascript
{
"type": "curve", // Bezier curve
"start": [x, y],
"end": [x, y],
"cpa": [x, y], // control point A
"cpb": [x, y], // control point B
"width": width,
}
```
--------------------------------
### Drawing Segment Structure
Source: https://github.com/openscopeproject/interactivehtmlbom/blob/master/DATAFORMAT.md
Represents a line segment drawing on the PCB. Includes start and end points, and width.
```javascript
{
"type": "segment",
"start": [x, y],
"end": [x, y],
"width": width,
}
```
--------------------------------
### Example of Escaping Commas in Fields
Source: https://github.com/openscopeproject/interactivehtmlbom/wiki/Usage
When providing comma-separated lists for arguments like `--extra-fields`, commas can be escaped with a backslash (`\`) to include them literally in field names. This example shows how to define fields with names containing commas.
```bash
python generate_interactive_bom.py --extra-fields "MFG\,MFG#,VEND1\,VEND1#"
```
--------------------------------
### Show Help Message
Source: https://github.com/openscopeproject/interactivehtmlbom/wiki/Usage
Run the script with the `--help` flag to display all available command-line options and their descriptions. This is useful for understanding the full range of configurable parameters.
```bash
python generate_interactive_bom.py --help
```
--------------------------------
### Show Configuration Dialog
Source: https://github.com/openscopeproject/interactivehtmlbom/wiki/Usage
Use the `--show-dialog` flag to launch the InteractiveHtmlBom configuration dialog. When this flag is used, all other command-line flags are ignored.
```bash
python generate_interactive_bom.py --show-dialog
```
--------------------------------
### Generate BOM from EasyEDA Project
Source: https://github.com/openscopeproject/interactivehtmlbom/wiki/Usage
Use the standalone script to generate an HTML BOM from an EasyEDA project. First, download the project's JSON source file, then pass its location to the script.
```shell
python .../generate_interactive_bom.py .../board.json
```
--------------------------------
### Run Interactive HTML BOM as Standalone Script (Windows)
Source: https://github.com/openscopeproject/interactivehtmlbom/wiki/Usage
On Windows, use the Python executable bundled with KiCad to run the Interactive HTML BOM script. This ensures compatibility with KiCad's environment.
```shell
path/to/kicad/bin/python.exe .../generate_interactive_bom.py .../board.kicad_pcb
```
--------------------------------
### Run InteractiveHtmlBom Plugin from Scripting Console
Source: https://github.com/openscopeproject/interactivehtmlbom/wiki/FAQ
Use this snippet to run the plugin manually from KiCad's scripting console to capture stack traces for bug reporting. Ensure you have imported the plugin correctly.
```python
from InteractiveHtmlBom import plugin
plugin.Run()
```
--------------------------------
### Configuration Structure
Source: https://github.com/openscopeproject/interactivehtmlbom/blob/master/DATAFORMAT.md
Defines various configuration options for the BOM tool, including display modes, highlighting, checkboxes, BOM view, layer view, and extra fields.
```js
config = {
"dark_mode": bool,
"show_pads": bool,
"show_fabrication": bool,
"show_silkscreen": bool,
"highlight_pin1": "none" | "all" | "selected",
"redraw_on_drag": bool,
"board_rotation": int,
"checkboxes": "checkbox1,checkbox2,...",
"bom_view": "bom-only" | "left-right" | "top-bottom",
"layer_view": "F" | "FB" | "B",
"extra_fields": ["field1_name", "field2_name", ...],
}
```
--------------------------------
### Footprint Structure
Source: https://github.com/openscopeproject/interactivehtmlbom/blob/master/DATAFORMAT.md
Defines a footprint with reference, center position, bounding box, pads, and drawings. Includes detailed pad properties like layers, position, size, shape, and type.
```js
{
"ref": reference,
"center": [x, y],
"bbox": {
// Position of the rotation center of the bounding box.
"pos": [x, y],
// Rotation angle in degrees.
"angle": angle,
// Left top corner position relative to center (after rotation)
"relpos": [x, y],
"size": [x, y],
},
"pads": [
{
"layers": [
// Contains one or both
"F", "B",
],
"pos": [x, y],
"size": [x, y],
"angle": angle,
// Only present if pad is considered first pin.
// Pins are considered first if it's name is one of
// 1, A, A1, P1, PAD1
// OR footprint has no pads named as one of above and
// current pad's name is lexicographically smallest.
"pin1": 1,
// Shape is one of "rect", "oval", "circle", "roundrect", "chamfrect", custom".
"shape": shape,
// Only present if shape is "custom".
// SVG path of the polygon given as 'd' attribute of svg spec.
// If "svgpath" is present "polygons", "pos", "angle" are ignored.
"svgpath": svgpath,
"polygons": [
// Set of polylines same as in polygon drawing.
[[point1x, point1y], [point2x, point2y], ...],
...
],
// Only present if shape is "roundrect" or "chamfrect".
"radius": radius,
// Only present if shape is "chamfrect".
// chamfpos is a bitmask, left = 1, right = 2, bottom left = 4, bottom right = 8
"chamfpos": chamfpos,
"chamfratio": ratio,
// Pad type is "th" for standard and NPTH pads
// "smd" otherwise.
"type": type,
// Present only if type is "th".
// One of "circle", "oblong" or "rect".
"drillshape": drillshape,
// Present only if type is "th". In case of circle shape x is diameter, y is ignored.
"drillsize": [x, y],
// Optional attribute.
"offset": [x, y],
// Optional net name
"net": netname,
},
...
],
"drawings": [
// Contains only copper F_Cu, B_Cu drawings of the footprint.
{
// One of "F", "B".
"layer": layer,
// See drawing struct description above.
"drawing": drawing,
},
...
],
// One of "F", "B".
"layer": layer,
}
```
--------------------------------
### HIGHLIGHT_EVENT Callback Parameters
Source: https://github.com/openscopeproject/interactivehtmlbom/wiki/Customization
Callback parameters for the highlight change event. Includes the row ID, references, and net information.
```javascript
{
eventType: 'highlightEvent',
args: {
rowid: rowid, // string
refs: [(ref, id), ...], // array of tuples
net: net // string
}
}
```
--------------------------------
### BOM_BODY_CHANGE_EVENT Callback Parameters
Source: https://github.com/openscopeproject/interactivehtmlbom/wiki/Customization
Callback parameters for the BOM table body change event. Includes filter and ref lookup textbox contents, checkbox names, and the current BOM mode.
```javascript
{
eventType: 'bomBodyChangeEvent',
args: {
filter: filter, // contents of filter textbox
reflookup: reflookup, // contents of ref lookup textbox
checkboxes: ['checkbox1', 'checkbox2', ...], // array of checkbox names
bommode: "grouped", "ungrouped", "netlist" // string
}
}
```
--------------------------------
### Drawing Circle Structure
Source: https://github.com/openscopeproject/interactivehtmlbom/blob/master/DATAFORMAT.md
Represents a circular drawing on the PCB. Includes center point, radius, and optional fill/width properties.
```javascript
{
"type": "circle",
"start": [x, y],
"radius": radius,
// Optional boolean, defaults to 0
"filled": 0,
// Line width (only has effect for non-filled shapes)
"width": width,
}
```
--------------------------------
### PCB Data Structure
Source: https://github.com/openscopeproject/interactivehtmlbom/blob/master/DATAFORMAT.md
The main pcbdata JSON object structure used to represent PCB information, including bounding boxes, drawings, footprints, tracks, zones, nets, metadata, BOM, and font data.
```javascript
pcbdata = {
// Describes bounding box of all edge cut drawings.
// Used for determining default zoom and pan values to fit
// whole board on canvas.
"edges_bbox": {
"minx": 1,
"miny": 2,
"maxx": 100,
"maxy": 200,
},
// Describes all edge cut drawings including ones in footprints.
// See drawing structure description below.
"edges": [drawing1, drawing2, ...],
"drawings": {
// Contains all drawings + reference + value texts on silkscreen
// layer grouped by front and back.
"silkscreen": {
"F": [drawing1, drawing2, ...],
"B": [drawing1, drawing2, ...],
},
// Same as above but for fabrication layer.
"fabrication": {
"F": [drawing1, drawing2, ...],
"B": [drawing1, drawing2, ...],
},
},
// Describes footprints.
// See footprint structure description below.
// index of entry corresponds to component's numeric ID
"footprints": [
footprint1,
footprint2,
...
],
// Optional track data. Vias are 0 length tracks.
"tracks": {
"F": [
{
// In case of line segment or via (via is 0 length segment)
"start": [x, y],
"end": [x, y],
// In case of arc
"center": [x, y],
"startangle":
"radius": radius,
"startangle": angle1,
"endangle": angle2,
// Common fields
"width": w,
// Optional net name
"net": netname,
// Optional drill diameter (un-tented vias only)
"drillsize": x
},
...
],
"B": [...]
},
// Optional zone data (should be present if tracks are present).
"zones": {
"F": [
{
// SVG path of the polygon given as 'd' attribute of svg spec.
// If "svgpath" is present "polygons" is ignored.
"svgpath": svgpath,
// optional fillrule flag, defaults to nonzero
"fillrule": "nonzero" | "evenodd",
"polygons": [
// Set of polylines same as in polygon drawing.
[[point1x, point1y], [point2x, point2y], ...],
],
// Optional net name.
"net": netname,
},
...
],
"B": [...]
},
// Optional net name list.
"nets": [net1, net2, ...],
// PCB metadata from the title block.
"metadata": {
"title": "title",
"revision": "rev",
"company": "Horns and Hoofs",
"date": "2019-04-18",
"variant": "var" // optional
},
// Contains full bom table as well as filtered by front/back.
// See bom row description below.
"bom": {
"both": [bomrow1, bomrow2, ...],
"F": [bomrow1, bomrow2, ...],
"B": [bomrow1, bomrow2, ...],
// numeric IDs of DNP components that are not in BOM
"skipped": [id1, id2, ...]
// Fields map is keyed on component ID with values being field data.
// It's order corresponds to order of fields data in config struct.
"fields" {
id1: [field1, field2, ...],
id2: [field1, field2, ...],
...
}
},
// Contains parsed stroke data from newstroke font for
// characters used on the pcb.
"font_data": {
"a": {
"w": character_width,
// Contains array of polylines that form the character shape.
"l": [
[[point1x, point1y], [point2x, point2y],...],
...
]
},
"%": {
...
},
...
},
}
```
--------------------------------
### CHECKBOX_CHANGE_EVENT Callback Parameters
Source: https://github.com/openscopeproject/interactivehtmlbom/wiki/Customization
Callback parameters for the checkbox state change event. Provides the checkbox name, references, and its new state.
```javascript
{
eventType: 'checkboxChangeEvent',
args: {
checkbox: checkbox, // string
refs: [(ref, id), ...], // array of tuples
state: 'checked' or 'unchecked' // string
}
}
```
--------------------------------
### Polygon Structure
Source: https://github.com/openscopeproject/interactivehtmlbom/blob/master/DATAFORMAT.md
Defines a polygon shape with optional fill, line width, SVG path, position, angle, and a set of outlines.
```js
{
"type": "polygon",
// Optional, defaults to 1
"filled": 1,
// Line width (only has effect for non-filled shapes)
"width": width
// SVG path of the polygon given as 'd' attribute of svg spec.
// If this parameter is specified everything below it is ignored.
"svgpath": svgpath,
"pos": [x, y],
"angle": angle,
"polygons": [
// Polygons are described as set of outlines.
[
[point1x, point1y], [point2x, point2y], ...
],
...
]
}
```
--------------------------------
### Text Structure
Source: https://github.com/openscopeproject/interactivehtmlbom/blob/master/DATAFORMAT.md
Defines text elements with position, content, optional SVG path, dimensions, justification, thickness, fill rule, attributes, and angle. Can also indicate reference or value text.
```js
{
"pos": [x, y],
"text": text,
// SVG path of the text given as 'd' attribute of svg spec.
// If this parameter is specified then height, width, angle,
// text attributes and justification is ignored. Rendering engine
// will not attempt to read character data from newstroke font and
// will draw the path as is. "thickness" will be used as stroke width.
"svgpath": svgpath,
// If polygons are specified then remaining attributes are ignored
"polygons": [
// Polygons are described as set of outlines.
[
[point1x, point1y], [point2x, point2y], ...
],
...
],
"height": height,
"width": width,
// -1: justify left/top
// 0: justify center
// 1: justify right/bot
"justify": [horizontal, vertical],
// Either the thickness or the fillrule must be used
"thickness": thickness,
// fillrule is only supported for svgpath
"fillrule": "nonzero" | "evenodd",
"attr": [
// may include none, one or both
"italic", "mirrored"
],
"angle": angle,
// Present only if text is reference designator
"ref": 1,
// Present only if text is component value
"val": 1,
}
```
--------------------------------
### Drawing Rectangle Structure
Source: https://github.com/openscopeproject/interactivehtmlbom/blob/master/DATAFORMAT.md
Represents a rectangular drawing on the PCB. Defined by two opposing corner points and width.
```javascript
{
"type": "rect",
"start": [x, y], // coordinates of opposing corners
"end": [x, y],
"width": width,
}
```
--------------------------------
### BOM Row Structure
Source: https://github.com/openscopeproject/interactivehtmlbom/blob/master/DATAFORMAT.md
Represents a row in the Bill of Materials, consisting of a list of reference sets. Each reference set is a tuple of a reference name and a unique footprint ID.
```js
[
[reference_name, footprint_id],
...
]
```
--------------------------------
### Drawing Arc Structure
Source: https://github.com/openscopeproject/interactivehtmlbom/blob/master/DATAFORMAT.md
Represents an arc drawing on the PCB. Can be defined by SVG path or center, radius, and angles. Includes width.
```javascript
{
"type": "arc",
"width": width,
// SVG path of the arc given as 'd' attribute of svg spec.
// If this parameter is specified everything below it is ignored.
"svgpath": svgpath,
"start": [x, y], // arc center
"radius": radius,
"startangle": angle1,
"endangle": angle2,
}
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.