Skip to content

.NET API

BypassApi

Bypass shanks — the ring body whose two arms cross past each other. Query-only for now: run ArtisanBypass in the UI once, then script every variant from the handle it leaves behind.

from ArtisanPlugin.Scripting import BypassApi

See also the guide, Shanks › Bypass, and the Python package, ra.bypass.

Methods

Method
AllIBypass handles for every object of this kind in the active document (empty when there is no document).
ByLayerIBypass 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 bypass shank — the ArtisanBypass tool, headless: a band whose two arms cross past each other instead of meeting.
FindThe handle for id, or null when the id does not belong to an object of this kind.
SelectedIBypass handles for the objects of this kind currently selected in the active document.

All

IReadOnlyList<IBypass> BypassApi.All()

IBypass handles for every object of this kind in the active document (empty when there is no document).

Returns IReadOnlyList<IBypass>.

ByLayer

IReadOnlyList<IBypass> BypassApi.ByLayer(string layerName)

IBypass handles on the layer with the given full path (empty when the layer does not exist).

ParameterTypeDefault
layerNamestringrequired

Returns IReadOnlyList<IBypass>.

Count

int BypassApi.Count()

Number of objects of this kind in the active document.

Returns int.

Create

IBypass BypassApi.Create(
    double fingerDiameter = 0,
    double topWidth = 0,
    double topHeight = 0,
    double bottomWidth = 0,
    double bottomHeight = 0,
    double armAngle = double.NaN,
    double armHeight = 0,
    double armWidth = 0,
    bool withGems = false,
    double gemSize = 0,
    string profile = null,
    Plane? plane = null,
    string element = null)

Builds a bypass shank — the ArtisanBypass tool, headless: a band whose two arms cross past each other instead of meeting. Millimetres / degrees; 0 keeps the tool default (or the user’s saved defaults). fingerDiameter 0 = the document’s finger size. withGems turns on the stone run along the arms. Returns an IBypass handle: use its setters for the rest of the model (the handle covers the full parameter set). element = name of a saved bypass element (ElementsApi.List(“ByPass”)) to start from instead of the tool defaults; explicit arguments override it.

ParameterTypeDefault
fingerDiameterdouble0
topWidthdouble0
topHeightdouble0
bottomWidthdouble0
bottomHeightdouble0
armAngledoubledouble.NaN
armHeightdouble0
armWidthdouble0
withGemsboolfalse
gemSizedouble0
profilestringnull
planePlane?null
elementstringnull

Returns IBypass.

Find

IBypass BypassApi.Find(Guid id)

The handle for id, or null when the id does not belong to an object of this kind.

ParameterTypeDefault
idGuidrequired

Returns IBypass.

Selected

IReadOnlyList<IBypass> BypassApi.Selected()

IBypass handles for the objects of this kind currently selected in the active document.

Returns IReadOnlyList<IBypass>.

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.

IBypass

Handle — extends IParametricObject.

Bypass ring shank: two arms that cross past each other instead of meeting. Multiple gems possible, so no single MotherGem.

PropertyType
GemsIBypassGemsget
IdGuidget(from IParametricObject)
LayerNamestringget(from IParametricObject)
MotherGemIdGuidget(from IParametricObject)
ObjectTypestringget(from IParametricObject)
PositionPoint3dget(from IParametricObject)
RingDiameterMmdoubleget
RingSizeLabelstringget
RingSizeRegionstringget
ShankIBypassShankgetParameter sections — each is a live view over the shank’s stored parameters; their setters regenerate the shank in place (same Guid) and call LicenseGate.RequireValid() first. Millimetres.
Method
void Delete()(from IParametricObject)
void Move(Vector3d translation)(from IParametricObject)
void SetElement(string element)Applies a saved ByPass element (ElementsApi.List(“ByPass”)) to this shank: its parameters replace the current ones, the ring size stays, and the shank regenerates in place (same id).

IBypassShank

Section.

The bypass band: the two band sections, the crossing arms and the optional bridge, plus the per-station cross-sections.

PropertyType
ArmAngledoublegetdegrees
ArmHeightdoublegetmm
ArmTangentdoubleget
ArmWidthdoublegetmm
BottomHeightdoublegetmm
BottomWidthdoublegetmm
BridgeAngledoublegetdegrees
BridgeDiameterdoublegetmm
BridgeEnabledboolget
BridgeThicknessdoublegetmm
BridgeWidthdoublegetmm
CapDistancedoublegetmm
Displacementdoublegethow far the arms pass each other, mm
DisplacementStartintgetrail point where the displacement starts
ProfileNamestringgetRING_PROFILE asset name, "" when unset
SharedProfileboolgetevery station uses the same profile asset
StationsIReadOnlyList<IBypassStation>get
TipRotationdoublegetroll of the tip about the rail tangent, degrees
TopHeightdoublegetmm
TopWidthdoublegetmm
UseStationsboolgetbuild from Stations instead of the top/bottom gradient
Method
void SetArmAngle(double degrees)
void SetArmHeight(double height)
void SetArmTangent(double tangent)
void SetArmWidth(double width)
void SetBottomHeight(double height)
void SetBottomWidth(double width)
void SetBridgeAngle(double degrees)
void SetBridgeDiameter(double diameter)
void SetBridgeEnabled(bool enabled)
void SetBridgeThickness(double thickness)
void SetBridgeWidth(double width)
void SetCapDistance(double distance)
void SetDisplacement(double displacement)
void SetDisplacementStart(int start)
void SetProfile(string assetName)RING_PROFILE asset by name — list them with AssetsApi.List(“RING_PROFILE”)
void SetSharedProfile(bool shared)
void SetStation( int index, double position, double width, double height, string profileName = null)
void SetStations(IEnumerable<IBypassStation> stations)Replaces the whole station list. Positions run 0 (arm tip) to 1 (ring bottom); profileName omitted keeps the shank’s profile.
void SetTipRotation(double degrees)
void SetTopHeight(double height)
void SetTopWidth(double width)
void SetUseStations(bool useStations)

IBypassStation

Section.

One cross-section along the bypass rail. Stations let the band change width, height and profile as it runs from the arm tip to the ring bottom.

PropertyType
Heightdoublegetmm
Positiondoubleget0 = arm tip, 1 = ring bottom
ProfileNamestringgetRING_PROFILE asset name, "" when unset
Widthdoublegetmm

IBypassGems

Section.

The gems row a bypass shank carries along each arm. A live view over the shank’s stored parameters: getters read the current values, setters regenerate the shank in place (same Guid) and are license-gated.

PropertyType
Angledoublegetarc covered by the row from each tip, degrees
AutomaticProngDiameterboolget
BrightCutdoublegetmm
DoubleProngSettingboolget
DrillAllowIntersectionboolget
DrillEnabledboolget
DrillHeightdoublegetmm
DrillTypestringget”NONE”, “ROUND” or “QUAD”
DrillVisibleboolget
DrillWidthdoublegetmm
Enabledboolget
EndProngCountintget
ExtensionForManufacturingdoublegetmm
GemInsidedoublegetmm
GemShapestringget”ROUND”, “PRINCESS”, …
GemSizedoublegetmm
GemSizeEnddoublegetmm
GemSizeMiddledoublegetmm
GemSizeStartdoublegetmm
GradientboolgetStone-size gradient along the row.
GradientMiddlePositiondoubleget0..1
GradientPointsintget
InnerHeightdoublegetinner channel height, mm
InnerMargindoublegetmm
InnerWidthdoublegetinner channel width, mm
Margindoublegetmm
MinDistancedoublegetmm
ProngDiameterdoublegetmm
ProngDistancedoublegetmm
ProngGrowdoublegetmm
ProngHeightdoublegetmm
ProngMinDiameterdoublegetmm
ProngSpacingdoublegetmm
ProngTypestringget”NONE”, “SHARED” or “SCALLOPED”
ScallopGemHeightdoubleget
ScallopGemWidthdoublegetScalloped-setting proportions (percentages, not mm).
ScallopProngHeightdoubleget
ScallopProngWidthdoubleget
ScallopRailHeightdoubleget
ScallopRailWidthdoubleget
ScallopRemoveChannelboolget
Verticaldoublegetmm
Method
void SetAngle(double degrees)
void SetAutomaticProngDiameter(bool automatic)
void SetBrightCut(double brightCut)
void SetDoubleProngSetting(bool enabled)
void SetDrillAllowIntersection(bool allow)
void SetDrillEnabled(bool enabled)
void SetDrillHeight(double height)
void SetDrillType(string drillType)”NONE”, “ROUND” or “QUAD”
void SetDrillVisible(bool visible)
void SetDrillWidth(double width)
void SetEnabled(bool enabled)
void SetEndProngCount(int count)
void SetExtensionForManufacturing(double extension)
void SetGemInside(double gemInside)
void SetGemShape(string shape)
void SetGemSize(double size)
void SetGemSizeGradient(double start, double middle, double end)
void SetGradient(bool enabled)
void SetGradientMiddlePosition(double position)0..1
void SetGradientPoints(int points)
void SetInnerHeight(double height)
void SetInnerMargin(double margin)
void SetInnerWidth(double width)
void SetMargin(double margin)
void SetMinDistance(double distance)
void SetProngDiameter(double diameter)
void SetProngDistance(double distance)
void SetProngGrow(double grow)
void SetProngHeight(double height)
void SetProngMinDiameter(double diameter)
void SetProngSpacing(double spacing)
void SetProngType(string prongType)”NONE”, “SHARED” or “SCALLOPED”
void SetScallopGem(double width, double height)
void SetScallopProng(double width, double height)
void SetScallopRail(double width, double height)
void SetScallopRemoveChannel(bool enabled)
void SetVertical(double vertical)