edit_materials
Add, remove, or patch coverage-rate rows on a finish condition, converting measured area or length into order quantities such as adhesive per gallon or grout per bag.
Instructions
Add, remove, or patch supporting-materials rows on a condition — the coverage-rate lines that turn a measured area/length/count into an order quantity (adhesive at N sf/gal, grout at N lf/bag, …), matching the canvas's per-condition Supporting Materials panel. Each row is {name, per, basis, unit, round, note}: quantity = the condition's basis total (area/linear/count/seam_lf) ÷ per, rounded up to whole purchase units unless round:false. basis "seam_lf" is the one basis that is FIGURED rather than measured: it is the length where two cuts meet on the floor, read off the condition's roll layout (set roll_setup with edit_condition), which is what a heat-weld rod or a carpet seam tape is bought by. A 20-ft-wide room off a 12-ft roll seams once down its length; the same square footage as two 10-ft rooms seams not at all, and no percentage of the area or the perimeter can tell those two jobs apart. Without a roll_setup — or with no committed floor shapes to lay out — a seam_lf row reads 0, which is the honest state rather than a guess. condition names an existing OR NEW finish tag (minted on first touch, same as one_click/measure_polygon) — add alone is enough to seed materials on a condition before you've traced anything. remove/patch target existing row ids from this reply or export_takeoff (takeoff_summary strips materials for a compact quantities-only reply); a bad id 404s the WHOLE call before anything is written, and referencing an id on a tag with no condition yet errors rather than silently minting an empty one. No review gate here — materials rows are quantity config, not traced geometry, so this edits directly; undo_last reverses a call in one step (the condition's whole materials array, snapshotted before the write, restored verbatim).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| add | No | New rows to add | |
| patch | No | Field changes on existing rows | |
| remove | No | Existing row ids to remove | |
| condition | Yes | Finish tag, e.g. 'CPT-1' |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| changed | Yes | ||
| condition | Yes | The finish tag passed in | |
| materials | Yes | The condition's full materials array after this write | |
| condition_id | Yes |