Skip to content

Scripting API

Matching shank

from ArtisanPlugin.Scripting import MatchingShankApi as matching

A band shaped to sit against an existing ring (the “mother”), so the pair stacks without a gap.

Create

No Create yet - fitting needs a mother ring picked in the document. Run ArtisanMatchingShank in the UI once, then script every variant from the handle.

Edit

The IMatchingShank handle is flat plus a gems section; each setter regenerates the shank in place, re-baking gems and prongs (and both bands when BothSides is on):

GroupWhat it edits
The fitClearance, Distance (negative presses into the mother), TopDistance, NumberOfPoints, FlipSide, BothSides, and per-section SectionDeltas
The bandProfile asset, top and bottom sections, interior type (solid or comfort) and comfort depth
GemsThe row: distribution (full, side, top) with its angles, size, spacing, channel top and bottom, a stone-size gradient, prongs (top/bottom diameters, growth, end count) and drills

Read-only outputs: MotherRingIds, RingCurveId, CurveFromRingSize, SectionContactOffsets (what the last computation measured).

from ArtisanPlugin.Scripting import MatchingShankApi as matching, Transaction

shank = matching.Selected()[0]
with Transaction.Begin("Tighter fit, stones on the sides"):
    shank.SetClearance(0.15)
    shank.Gems.SetEnabled(True)
    shank.Gems.SetDistribution("SIDE")
    shank.Gems.SetSideAngles(30, 150)

Queries

All(), Find(id), Count(), Selected(), ByLayer(name). Plus ForRing(ringId) - the matching shanks fitted against a given ring.