Skip to content

Scripting API

Sprue single

from ArtisanPlugin.Scripting import ManufacturingApi as manufacturing

The single sprue is the simplest feed: one short tapered post attached to the piece at the point where the molten metal will enter — the connector a caster solders between a small piece and the wax tree. This is the ArtisanSprueSingle tool run headless: the tool’s pick-point-on-mesh prompt becomes the point argument.

Usage

id = manufacturing.SprueSingle(meshId, point, height = 0,
                               topX = 0, topY = 0, bottomX = 0, bottomY = 0,
                               insideRing = 0)      # -> Guid
ParameterDefaultMeaning
meshIdrequiredThe piece mesh; the sprue attaches to it
pointrequiredWhere the sprue meets the piece — it should lie on the mesh
height2Length of the post, mm
topX, topY1.5 × 1.5Section at the top (free) end, mm
bottomX, bottomY1.5 × 1.5Section at the bottom (contact) end, mm
insideRing0.2How far the post sinks into the piece for a clean weld, mm

Every numeric parameter follows the house 0-keeps-default convention: 0 means “use the tool’s default, or my saved sprue-single defaults”. None of these numbers has a meaningful zero and there is no -1 sentinel.

SprueSingle returns a single Guid — the id of one sprue mesh. Unlike the other sprue methods, the mesh is added as-is: it lands on the document’s current layer with no colour override, exactly what the tool’s Accept does. The source mesh is only read (the method works on a duplicate), never modified.

It needs a valid licence and fails with “No active document.” when there is none. If meshId does not resolve to a mesh it raises “Object {id} is not a mesh.”, and if the geometry cannot be built it raises “Sprue computation failed. Check that the point lies on the mesh.” and nothing is added. Wrap the call in a Transaction to get one-step undo.