Skip to content

.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
AllITwistedShank handles for every object of this kind in the active document (empty when there is no document).
ByLayerITwistedShank handles on the layer with the given full path (empty when the layer does not exist).
CountNumber of objects of this kind in the active document.
CreateBuilds a twisted shank — the ArtisanTwistedShank tool, headless.
FindThe handle for id, or null when the id does not belong to an object of this kind.
SelectedITwistedShank 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).

ParameterTypeDefault
layerNamestringrequired

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.

ParameterTypeDefault
fingerDiameterdouble0
topWidthdouble0
topHeightdouble0
bottomWidthdouble0
bottomHeightdouble0
profilestringnull
interiorstringnull
twistbool?null
startAngledoubledouble.NaN
endAngledoubledouble.NaN
transitiondouble0
pitchdouble0
depthdoubledouble.NaN
mirrorbool?null
interiorSmoothbool?null
openingstringnull
cutLengthdouble0
cutBumpingdoubledouble.NaN
strangleOpeningdouble0
strangleBaseXdouble0
strangleBaseYdouble0
strangleBaseZdouble0
planePlane?null
elementstringnull

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.

ParameterTypeDefault
idGuidrequired

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.

PropertyType
BottomProfileITwistedShankProfileget
IdGuidget(from IParametricObject)
LayerNamestringget(from IParametricObject)
MotherGemIdGuidget(from IParametricObject)
ObjectTypestringget(from IParametricObject)
OpeningITwistedShankOpeningget
PositionPoint3dget(from IParametricObject)
RingDiameterMmdoubleget
RingSizeLabelstringget
RingSizeRegionstringget
TopProfileITwistedShankProfileget
TwistITwistedShankTwistget
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.

PropertyType
Depthdoublegetmm, groove depth
Enabledboolget
EndAngledoublegetdegrees from the top where it starts fading out
InteriorSmoothboolgettrue = only the outer part twists, the inside stays smooth
Mirrorboolgettrue = the two sides twist as mirror images
Pitchdoublegetmm along the band between two grooves
StartAngledoublegetdegrees from the top where the twist is fully in
Transitiondoublegetdegrees 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.

PropertyType
Comfortdoublegetmm, the comfort dome’s depth (used when Type is “COMFORT”)
Heightdoublegetmm, radial
ProfileNamestringgetRING_PROFILE asset name, "" when unset
Typestringget”SOLID” or “COMFORT”
Widthdoublegetmm, 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).

PropertyType
CutBumpingdoublegetmm, bulge of the CUT caps (0 = flat)
CutLengthdoublegetmm of arc on the finger, CUT
StrangleBaseXdoublegetmm, STRANGLE base length along the finger curve
StrangleBaseYdoublegetmm, STRANGLE base width across the band
StrangleBaseZdoublegetmm, STRANGLE base thickness
StrangleOpeningdoublegetmm, STRANGLE: where the band starts narrowing
Typestringget”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”