Skip to content

Scripting API

Twisted

from ArtisanPlugin.Scripting import TwistedShankApi as twisted

A solitaire band with plain shoulders under the head, two twisted strands like a rope on the sides, a plain back and a smooth inside. The head is a separate setting on the centre stone. See Twisted Shank for the design side.

Create

TwistedShankApi.Create builds one headless, as the ArtisanTwistedShank panel would. Every argument is optional; 0 (or None) keeps the tool default or your saved defaults:

ArgumentDefault
fingerDiameterdocumentInner diameter, mm
topWidth, topHeight1.8, 1.6The section under the head, mm
bottomWidth, bottomHeight2.2, 1.5The section at the back, mm; the band blends between the two
profiledefaultRING_PROFILE asset name, for both sections
interior"COMFORT""SOLID" or "COMFORT", both sections
twistTrueFalse builds a plain band
startAngle, endAngle40, 140Degrees from the top, both sides alike
transition12Degrees the strands take to fade in and out
pitch, depth2.2, 0.45mm between two grooves, and groove depth
mirrorTrueThe two sides twist as mirror images
interiorSmoothTrueOnly the outer part twists
opening"NONE""NONE", "CUT" (cutLength, cutBumping) or "STRANGLE" (strangleOpening, strangleBaseX/Y/Z), as the Classic opening
planeworld XY
element-Saved TwistedShank element to start from; explicit arguments override it
import rhinoartisan as ra

ring = ra.twisted_shank.create(pitch=1.8, depth=0.5, start_angle=30, end_angle=150)

Edit

ITwistedShank has four sections. Each setter regenerates the shank in place:

SectionWhat it edits
TopProfile / BottomProfileWidth, height, profile asset and interior of each section
TwistSetEnabled, SetAngles(start, end), SetTransition, SetPitch (0.2 or more), SetDepth, SetMirror, SetInteriorSmooth
OpeningThe Classic opening: NONE, CUT or STRANGLE with their values
from ArtisanPlugin.Scripting import TwistedShankApi as twisted, Transaction

ring = twisted.Selected()[0]
with Transaction.Begin("Tighter twist, same hand all round"):
    ring.Twist.SetPitch(1.6)
    ring.Twist.SetMirror(False)

The MCP assistant uses the same call through create_twisted_shank, and edits the result with edit_object.

Queries

All(), Find(id), Count(), Selected(), ByLayer(name).