bom_extract
Walk an assembly to generate a bill of materials grouped by source component, optionally flattening subassemblies and checking whether purchased parts are stocked or orderable.
Instructions
Walk an assembly and return [{part, count, total_volume_mm3, total_mass_kg?}, ...] grouped by source (component file + object), NOT the bare object name, so two distinct components both named "Box" don't collapse into one row. density (kg/mm³) is optional.
recursive (default True): descend into linked subassemblies (App::Part) so the BOM flattens to leaf parts. False counts each subassembly as one line.
orderable (default False): opt in to the BUYABILITY view — is every purchased line on this BOM a part that actually exists off the shelf? The default return is unchanged — a bare list — because everything downstream consumes it. With orderable=True you instead get a dict:
rows the same BOM rows, each also carrying designation / standard / part_class plus the catalog verdict (stocked, catalog_code, catalog) consumables purchased parts that are NOT modelled objects and would otherwise never reach a BOM — today the O-ring an oring_groove was cut for, counted across every part that calls for it undesignated purchased rows a buyer cannot order from (no designation) not_stocked rows naming a part nobody stocks, each with a reason and the nearest stocked alternatives designation the full designation_check verdict stocked_count how many purchased lines resolved to a stocked item ok False when anything purchased is undesignated OR not stocked
check_stock=False designates without checking availability. A design built out of
fasteners that do not exist is the failure this catches, and the offending rows
stay IN the list rather than being quietly dropped. Availability is a curated
snapshot of a market (captured, market), not physics.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| density | No | ||
| assembly | Yes | ||
| orderable | No | ||
| recursive | No | ||
| check_stock | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |