.NET API
TwistedShankApi
Twisted shanks - a solitaire band with plain shoulders under the head, two twisted strands on the sides, a plain back and a smooth inside (the ArtisanTwistedShank tool). The head is a separate setting.
from ArtisanPlugin.Scripting import TwistedShankApi
See also the guide, Shanks › Twisted, and the Python package, ra.twisted_shank.
Methods
| Method | |
|---|---|
All | ITwistedShank handles for every object of this kind in the active document (empty when there is no document). |
ByLayer | ITwistedShank handles on the layer with the given full path (empty when the layer does not exist). |
Count | Number of objects of this kind in the active document. |
Create | Builds a twisted shank — the ArtisanTwistedShank tool, headless. |
Find | The handle for id, or null when the id does not belong to an object of this kind. |
Selected | ITwistedShank handles for the objects of this kind currently selected in the active document. |
All
IReadOnlyList<ITwistedShank> TwistedShankApi.All()
ITwistedShank handles for every object of this kind in the active document (empty when there is no document).
Returns IReadOnlyList<ITwistedShank>.
ByLayer
IReadOnlyList<ITwistedShank> TwistedShankApi.ByLayer(string layerName)
ITwistedShank handles on the layer with the given full path (empty when the layer does not exist).
| Parameter | Type | Default |
|---|---|---|
layerName | string | required |
Returns IReadOnlyList<ITwistedShank>.
Count
int TwistedShankApi.Count()
Number of objects of this kind in the active document.
Returns int.
Create
ITwistedShank TwistedShankApi.Create(
double fingerDiameter = 0,
double topWidth = 0,
double topHeight = 0,
double bottomWidth = 0,
double bottomHeight = 0,
string profile = null,
string interior = null,
bool? twist = null,
double startAngle = double.NaN,
double endAngle = double.NaN,
double transition = 0,
double pitch = 0,
double depth = double.NaN,
bool? mirror = null,
bool? interiorSmooth = null,
string opening = null,
double cutLength = 0,
double cutBumping = double.NaN,
double strangleOpening = 0,
double strangleBaseX = 0,
double strangleBaseY = 0,
double strangleBaseZ = 0,
Plane? plane = null,
string element = null)
Builds a twisted shank — the ArtisanTwistedShank tool, headless. Millimetres; 0 keeps the tool default (or the user’s saved defaults): top profile 1.8 x 1.6 (under the head), bottom profile 2.2 x 1.5 (the back), the band blending between them. fingerDiameter 0 = the document’s finger size. profile picks a RING_PROFILE asset by name for both sections; interior SOLID or COMFORT (both sections). The twist: twist false = a plain band. startAngle / endAngle (degrees from the top, both sides alike; defaults 40 / 140) bound the twisted stretch, fading in and out over transition degrees (12); pitch mm between two grooves (2.2), depth mm deep (0.45); mirror (default true) twists the two sides as mirror images; interiorSmooth (default true) keeps the inside smooth. NaN / null keep the value. opening NONE (default, closed), CUT (open over cutLength mm, caps bulged by cutBumping) or STRANGLE (narrowed to a strangleBaseY x strangleBaseZ base over strangleBaseX mm, back to the band strangleOpening mm apart) - Classic’s opening. element = name of a saved TwistedShank element (ElementsApi.List(“TwistedShank”)) to start from; explicit arguments override it. Returns the ITwistedShank handle.
| Parameter | Type | Default |
|---|---|---|
fingerDiameter | double | 0 |
topWidth | double | 0 |
topHeight | double | 0 |
bottomWidth | double | 0 |
bottomHeight | double | 0 |
profile | string | null |
interior | string | null |
twist | bool? | null |
startAngle | double | double.NaN |
endAngle | double | double.NaN |
transition | double | 0 |
pitch | double | 0 |
depth | double | double.NaN |
mirror | bool? | null |
interiorSmooth | bool? | null |
opening | string | null |
cutLength | double | 0 |
cutBumping | double | double.NaN |
strangleOpening | double | 0 |
strangleBaseX | double | 0 |
strangleBaseY | double | 0 |
strangleBaseZ | double | 0 |
plane | Plane? | null |
element | string | null |
Returns ITwistedShank.
Find
ITwistedShank TwistedShankApi.Find(Guid id)
The handle for id, or null when the id does not belong to an object of this kind.
| Parameter | Type | Default |
|---|---|---|
id | Guid | required |
Returns ITwistedShank.
Selected
IReadOnlyList<ITwistedShank> TwistedShankApi.Selected()
ITwistedShank handles for the objects of this kind currently selected in the active document.
Returns IReadOnlyList<ITwistedShank>.
Handles and sections
What the methods above hand back. A handle’s setters regenerate the object; wrap changes in a Transaction so they land as one undo step.
ITwistedShank
Handle — extends IParametricObject.
Twisted solitaire shank: plain shoulders under the head, two twisted strands on the sides, a plain back and a smooth inside. The head is a separate setting.
| Property | Type | ||
|---|---|---|---|
BottomProfile | ITwistedShankProfile | get | |
Id | Guid | get | (from IParametricObject) |
LayerName | string | get | (from IParametricObject) |
MotherGemId | Guid | get | (from IParametricObject) |
ObjectType | string | get | (from IParametricObject) |
Opening | ITwistedShankOpening | get | |
Position | Point3d | get | (from IParametricObject) |
RingDiameterMm | double | get | |
RingSizeLabel | string | get | |
RingSizeRegion | string | get | |
TopProfile | ITwistedShankProfile | get | |
Twist | ITwistedShankTwist | get |
| Method | |
|---|---|
void Delete() | (from IParametricObject) |
void Move(Vector3d translation) | (from IParametricObject) |
void SetElement(string element) | Applies a saved TwistedShank element (ElementsApi.List(“TwistedShank”)) to this shank: its parameters replace the current ones, the ring size stays, and the shank regenerates in place (same id). |
ITwistedShankTwist
Section.
The twisted stretch on each side: two strands whose groove turns round the outer part of the band. Angles in degrees from the top (the head), 0-180, the same on both sides.
| Property | Type | ||
|---|---|---|---|
Depth | double | get | mm, groove depth |
Enabled | bool | get | |
EndAngle | double | get | degrees from the top where it starts fading out |
InteriorSmooth | bool | get | true = only the outer part twists, the inside stays smooth |
Mirror | bool | get | true = the two sides twist as mirror images |
Pitch | double | get | mm along the band between two grooves |
StartAngle | double | get | degrees from the top where the twist is fully in |
Transition | double | get | degrees over which it fades in / out at each end |
| Method | |
|---|---|
void SetAngles(double startAngle, double endAngle) | degrees from the top, 0 <= start < end <= 180 |
void SetDepth(double depth) | mm, 0 or more |
void SetEnabled(bool enabled) | |
void SetInteriorSmooth(bool smooth) | |
void SetMirror(bool mirror) | |
void SetPitch(double pitch) | mm, 0.2 or more |
void SetTransition(double degrees) |
ITwistedShankProfile
Section.
One of the twisted shank’s two sections: Top (under the head) and Bottom (the back of the ring); the band blends between them.
| Property | Type | ||
|---|---|---|---|
Comfort | double | get | mm, the comfort dome’s depth (used when Type is “COMFORT”) |
Height | double | get | mm, radial |
ProfileName | string | get | RING_PROFILE asset name, "" when unset |
Type | string | get | ”SOLID” or “COMFORT” |
Width | double | get | mm, along the finger |
| Method | |
|---|---|
void SetComfort(double comfort) | |
void SetHeight(double height) | |
void SetProfile(string assetName) | RING_PROFILE asset by name |
void SetType(string type) | ”SOLID” or “COMFORT” |
void SetWidth(double width) |
ITwistedShankOpening
Section.
The top of the band under the head, as Classic’s opening: NONE (closed), CUT (open, the ends capped flat or bulged) or STRANGLE (narrowed to a small base).
| Property | Type | ||
|---|---|---|---|
CutBumping | double | get | mm, bulge of the CUT caps (0 = flat) |
CutLength | double | get | mm of arc on the finger, CUT |
StrangleBaseX | double | get | mm, STRANGLE base length along the finger curve |
StrangleBaseY | double | get | mm, STRANGLE base width across the band |
StrangleBaseZ | double | get | mm, STRANGLE base thickness |
StrangleOpening | double | get | mm, STRANGLE: where the band starts narrowing |
Type | string | get | ”NONE”, “CUT” or “STRANGLE” |
| Method | |
|---|---|
void SetCutBumping(double bumping) | |
void SetCutLength(double length) | |
void SetStrangle(double opening, double baseX, double baseY, double baseZ) | STRANGLE: opening (mm) must stay greater than baseX |
void SetType(string type) | ”NONE”, “CUT” or “STRANGLE” |