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:
| Argument | Default | |
|---|---|---|
fingerDiameter | document | Inner diameter, mm |
topWidth, topHeight | 1.8, 1.6 | The section under the head, mm |
bottomWidth, bottomHeight | 2.2, 1.5 | The section at the back, mm; the band blends between the two |
profile | default | RING_PROFILE asset name, for both sections |
interior | "COMFORT" | "SOLID" or "COMFORT", both sections |
twist | True | False builds a plain band |
startAngle, endAngle | 40, 140 | Degrees from the top, both sides alike |
transition | 12 | Degrees the strands take to fade in and out |
pitch, depth | 2.2, 0.45 | mm between two grooves, and groove depth |
mirror | True | The two sides twist as mirror images |
interiorSmooth | True | Only the outer part twists |
opening | "NONE" | "NONE", "CUT" (cutLength, cutBumping) or "STRANGLE" (strangleOpening, strangleBaseX/Y/Z), as the Classic opening |
plane | world 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:
| Section | What it edits |
|---|---|
TopProfile / BottomProfile | Width, height, profile asset and interior of each section |
Twist | SetEnabled, SetAngles(start, end), SetTransition, SetPitch (0.2 or more), SetDepth, SetMirror, SetInteriorSmooth |
Opening | The 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).