Scripting API
Sprue multiple copies
from ArtisanPlugin.Scripting import ManufacturingApi as manufacturing
This is the hand-sprued runner: a tapered trunk laid alongside the piece (or a row of pieces) with one curved branch from the trunk to each chosen contact point — the layout a caster draws by hand when a design needs metal fed at several specific spots. It is the ArtisanSprueMultipleCopies tool run headless: the tool’s three interactive picks become trunkStart, trunkEnd and contactPoints.
Usage
ids = manufacturing.SprueMultipleCopies(meshIds, trunkStart, trunkEnd, contactPoints,
topDiameter = 0, bottomDiameter = 0,
branchTrunkDiameter = 0,
branchContactDiameter = 0) # -> [ids]
| Parameter | Default | Meaning |
|---|---|---|
meshIds | current selection | The piece mesh(es), merged into one working mesh like the tool’s selector; None or empty uses whatever is selected |
trunkStart | required | Bottom end of the trunk |
trunkEnd | required | Top end of the trunk |
contactPoints | required | Points on the mesh the branches reach; at least one |
topDiameter | 1.3 | Trunk diameter at the top, mm |
bottomDiameter | 2.3 | Trunk diameter at the bottom, mm |
branchTrunkDiameter | 1.2 | Branch diameter where it leaves the trunk, mm |
branchContactDiameter | 0.8 | Branch diameter where it touches the piece, mm |
Every numeric parameter follows the house 0-keeps-default convention: 0 means “use the tool’s default, or my saved multiple-copies defaults”. There is no -1 sentinel.
Where the tool asks you to pick a matching point on the trunk for every contact, this method projects each contact onto the trunk line instead — each branch leaves the trunk at the contact’s closest point on it, the natural headless equivalent.
It returns an IReadOnlyList<Guid> — the ids of the meshes added: the trunk plus one mesh per branch, baked to the last user layer with the wax preview colour, same as the tool’s Accept. The source meshes are only read, never modified.
It needs a valid licence and fails with “No active document.” when there is none. If nothing resolves to a mesh it raises “No meshes to work with: select (or pass) at least one mesh.”; an empty contactPoints raises “At least one contact point on the mesh is required.”; and if the geometry cannot be built it raises “Sprue computation failed. Check that the contact points lie on the mesh.”, or “Sprue computation failed with the given parameters (…).” when the kernel rejects the numbers. Nothing is added on failure. Wrap the call in a Transaction to get one-step undo.