design_generate_bom
Generate a consolidated bill of materials from a design plan's parts in one call, grouping parts into orderable lines and flagging entries that still need a manufacturer part number.
Instructions
Derive the bill of materials from a plan's parts in one call.
Every design needs a BOM, and it is mechanical to build from parts
you already authored -- this rolls them up so you do not hand-group
refdes (redundant with the parts, and easy to miscount). Parts with
an mpn consolidate by (manufacturer, mpn) -- one orderable
line each; parts without an mpn consolidate by (lib_ref, value, footprint) -- so every 100 nF 0402 cap is one line. Deterministic
(natural-sorted, R2 before R10). Pure Python, no Altium.
lines_without_mpn flags lines that still need a manufacturer
part number before the BOM is orderable -- the gaps to fill.
Args:
plan_json: the DesignPlan as a JSON string or dict.
set_on_plan: when True (default), the returned plan carries
the generated BOM in its bom field, ready for
design_execute_plan; the parts are unchanged.
Returns:
{ok, bom: [{refdes_list, manufacturer, mpn, description, qty}], summary: {line_count, total_parts, lines_without_mpn}, plan?}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plan_json | Yes | ||
| set_on_plan | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||