Skip to content

.NET API

BailApi

Bail smart component (the pendant hanger loop) — the ArtisanBail tool, headless. The result is the same editable smart component the panel inserts: a group carrying the serialized parameters, with the bail (and optional o-ring) breps as Artisan brep objects with the metal material.

from ArtisanPlugin.Scripting import BailApi

See also the guide, Accessories › Bail, and the Python package, ra.bail.

Methods

Method
CreateCreates a bail on plane (defaults to the active view’s construction plane, like the tool).

Create

IReadOnlyList<Guid> BailApi.Create(
    Plane? plane = null,
    double diameterTop = 0,
    double diameterBottom = 0,
    double distance = 0,
    bool withORing = false,
    string name = null,
    string profile = null,
    double topWidth = 0,
    double topHeight = 0,
    double bottomWidth = 0,
    double bottomHeight = 0,
    string topProfile = null,
    string bottomProfile = null,
    double startingOnTop = double.NaN,
    double startingOnBottom = double.NaN,
    double curveTension = double.NaN,
    double oRingThickness = 0,
    double oRingDiameter = 0,
    double oRingOverlap = 0,
    double oRingRotation = double.NaN,
    string element = null)

Creates a bail on plane (defaults to the active view’s construction plane, like the tool). Millimetres; 0 keeps the tool default (or the user’s saved defaults): diameterTop 3, diameterBottom 1, distance 5. withORing true also builds the torus o-ring; false (default) builds none. The wire cross-section drives the weight: topWidth/topHeight (default 4 x 1.4) and bottomWidth/bottomHeight (default 1 x 1); profile sets both profile assets, topProfile/bottomProfile each one. startingOnTop, startingOnBottom (default 0.5) and curveTension (default 1) shape the side curves; NaN keeps the default. oRingThickness (1), oRingDiameter (2), oRingOverlap (1) size the o-ring; oRingRotation in degrees (0; NaN keeps it). Returns the ids of the created breps. element = name of a saved Bail element (ElementsApi.List(“Bail”)) to start from; explicit arguments override it (profile names replace its profiles; withORing false keeps its o-ring setting).

ParameterTypeDefault
planePlane?null
diameterTopdouble0
diameterBottomdouble0
distancedouble0
withORingboolfalse
namestringnull
profilestringnull
topWidthdouble0
topHeightdouble0
bottomWidthdouble0
bottomHeightdouble0
topProfilestringnull
bottomProfilestringnull
startingOnTopdoubledouble.NaN
startingOnBottomdoubledouble.NaN
curveTensiondoubledouble.NaN
oRingThicknessdouble0
oRingDiameterdouble0
oRingOverlapdouble0
oRingRotationdoubledouble.NaN
elementstringnull

Returns IReadOnlyList<Guid>.