Sheet: Extract Bill of Materials
bom_extractRead AutoCAD block inserts to generate an ISO 7573 bill of materials without altering the drawing. Outputs item rows with quantities, designations, and standards.
Instructions
Walk the INSERTs and return the ISO 7573 item rows. Never modifies the
drawing. bom_table is what draws them.
Each row's source is reported: xdata when the ACADMCP_MECH payload
supplied it (what std_part_insert writes), attributes when the block's
own ATTRIBs did. A block with neither a payload nor a DESIGNATION attribute
is skipped rather than guessed at, and skipped counts them.
The whole drawing is read by default — entity_list's 200-entity page is
paged through, not taken as a cap, because an item list that stops at the
200th INSERT prints a wrong QTY rather than a shorter one. Pass limit to
cap it deliberately; truncated is then true if and only if the cap cut
the list. Refusals: an unknown column or group_by field, named with the
list of the ones there are.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layer | No | Only read INSERTs on this layer; empty reads all. | |
| limit | No | Stop after this many item records; 0 (the default) reads the whole drawing. `truncated` says whether the cap cut the list. | |
| columns | No | Columns to return; default item, qty, designation, standard, material. | |
| group_by | No | Field to group identical parts by: designation, standard, material, or '' for one row per insert. | designation |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||