.NET API
BasketApi
Basket settings: prongs, upper and base rails.
from ArtisanPlugin.Scripting import BasketApi
See also the guide, Gemsets › Basket, and the Python package, ra.basket.
Methods
| Method | |
|---|---|
All | IBasket handles for every object of this kind in the active document (empty when there is no document). |
ByGemMaterial | |
ByLayer | IBasket 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 basket setting under an existing gem — the ArtisanBasket tool, headless. |
Find | The handle for id, or null when the id does not belong to an object of this kind. |
ForGem | IBasket handles whose mother gem is gemId (empty for Guid.Empty). |
Selected | Baskets currently selected in the active doc. |
All
IReadOnlyList<IBasket> BasketApi.All()
IBasket handles for every object of this kind in the active document (empty when there is no document).
Returns IReadOnlyList<IBasket>.
ByGemMaterial
IReadOnlyList<IBasket> BasketApi.ByGemMaterial(string materialName)
| Parameter | Type | Default |
|---|---|---|
materialName | string | required |
Returns IReadOnlyList<IBasket>.
ByLayer
IReadOnlyList<IBasket> BasketApi.ByLayer(string layerName)
IBasket handles on the layer with the given full path (empty when the layer does not exist).
| Parameter | Type | Default |
|---|---|---|
layerName | string | required |
Returns IReadOnlyList<IBasket>.
Count
int BasketApi.Count()
Number of objects of this kind in the active document.
Returns int.
Create
IReadOnlyList<IBasket> BasketApi.Create(
IEnumerable<Guid> gemIds = null,
int prongs = 0,
double prongDiameter = 0,
double prongHeight = 0,
double prongHeightOverGirdle = 0,
double gemInside = double.NaN,
bool? upperRail = null,
bool? baseRail = null,
string support = null,
string prongMode = null,
string prongProfile = null,
double prongDiameterBottom = 0,
double prongRotation = double.NaN,
bool? straightProng = null,
double supportWidth = 0,
double supportThickness = 0,
double upperRailWidth = 0,
double upperRailHeight = 0,
double upperRailHeightUnderGirdle = 0,
double upperRailGemSizePercentage = 0,
string upperRailProfile = null,
double baseRailWidth = 0,
double baseRailHeight = 0,
double baseRailMoveInZ = double.NaN,
double baseRailGemSizePercentage = 0,
string baseRailProfile = null,
string element = null,
string prongType = null,
double overlap = double.NaN,
bool? vProngs = null,
double vThickness = 0,
double vArmLength = 0)
Builds a basket setting under an existing gem — the ArtisanBasket tool, headless. One basket (its own group) per gem; gemIds null/empty = the currently selected gems. Millimetres; 0 keeps the tool default (or the user’s saved defaults): prongDiameter 1.5 (sets top/girdle/bottom together), prongHeight 4, prongHeightOverGirdle 0.3. prongs 0 keeps the default (4 rotated); positive/negative counts follow the tool (negative = rotated variant). gemInside defaults to 0.35. Those tool defaults are sized for a 5 mm stone and scale to the first gem, as in the panel (prong sizes, rails, gem inside, supports); a saved element scales from the stone it was saved on; the user’s saved defaults are used as they are on the first gem. Every other gem gets that design scaled by its size ratio to the first, so stones of different sizes each get a basket in proportion. Explicit arguments are never scaled. upperRail/baseRail null keep the defaults (both enabled). support is NONE (default), SINGLE or DOUBLE. prongMode is ROUND (default), CUSTOM (the prongProfile section; a profile alone implies it, and the section starts turned 90 degrees unless prongRotation says otherwise) or CLAW; DEFAULT and CIRCLE also mean ROUND. Claw tips are built in Render mode only; tune them through the handle’s Prong section (SetClawGemInside…). prongType is SINGLE (default), DOUBLE (a pair side by side on every position) or TRIPLE (the pair plus a thinner prong between them): ROUND prongs take all three, CLAW SINGLE or DOUBLE (the Double Claw), CUSTOM only SINGLE. overlap (mm, default 0) is how much the prongs of a pair, and the Triple’s middle, cross: 0 = they touch, never a gap; taken literally (omit it to keep the default). vProngs true = V prongs: every prong position on a sharp corner of the girdle gets a V that wraps the corner instead of a round prong - the four corners of a princess, the tip of a pear or a heart, the tips of a six-prong marquise (its four-prong layout holds the sides and has no corner), the corners of a trillion. Round prongs only (ROUND mode); the other positions keep their prongs. vThickness (metal width) and vArmLength (how far each arm runs along the girdle) in mm; 0 keeps them in proportion to the prong diameter. Returns one IBasket handle per gem, in input order. element = name of a saved Basket element (ElementsApi.List(“Basket”)) to start from instead of the defaults; explicit arguments override it.
| Parameter | Type | Default |
|---|---|---|
gemIds | IEnumerable<Guid> | null |
prongs | int | 0 |
prongDiameter | double | 0 |
prongHeight | double | 0 |
prongHeightOverGirdle | double | 0 |
gemInside | double | double.NaN |
upperRail | bool? | null |
baseRail | bool? | null |
support | string | null |
prongMode | string | null |
prongProfile | string | null |
prongDiameterBottom | double | 0 |
prongRotation | double | double.NaN |
straightProng | bool? | null |
supportWidth | double | 0 |
supportThickness | double | 0 |
upperRailWidth | double | 0 |
upperRailHeight | double | 0 |
upperRailHeightUnderGirdle | double | 0 |
upperRailGemSizePercentage | double | 0 |
upperRailProfile | string | null |
baseRailWidth | double | 0 |
baseRailHeight | double | 0 |
baseRailMoveInZ | double | double.NaN |
baseRailGemSizePercentage | double | 0 |
baseRailProfile | string | null |
element | string | null |
prongType | string | null |
overlap | double | double.NaN |
vProngs | bool? | null |
vThickness | double | 0 |
vArmLength | double | 0 |
Returns IReadOnlyList<IBasket>.
Find
IBasket BasketApi.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 IBasket.
ForGem
IReadOnlyList<IBasket> BasketApi.ForGem(Guid gemId)
IBasket handles whose mother gem is gemId (empty for Guid.Empty).
| Parameter | Type | Default |
|---|---|---|
gemId | Guid | required |
Returns IReadOnlyList<IBasket>.
Selected
IReadOnlyList<IBasket> BasketApi.Selected()
Baskets currently selected in the active doc.
Returns IReadOnlyList<IBasket>.
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.
IBasket
Handle — extends IGemSetting, IParametricObject.
| Property | Type | ||
|---|---|---|---|
BaseRail | IBasketRail | get | |
GemCaratWeight | double | get | (from IGemSetting) |
GemMaterial | string | get | (from IGemSetting) |
GemShape | string | get | (from IGemSetting) |
Id | Guid | get | (from IParametricObject) |
LayerName | string | get | (from IParametricObject) |
MotherGemId | Guid | get | (from IParametricObject) |
ObjectType | string | get | (from IParametricObject) |
Position | Point3d | get | (from IParametricObject) |
Prong | IBasketProng | get | The rest of the tool’s parameters, grouped as the panel groups them. |
ProngCount | int | get | signed: negative = the rotated layout |
ProngDiameterBottom | double | get | |
ProngDiameterGirdle | double | get | stored for older files only: the prong’s girdle section is built from ProngDiameterTop |
ProngDiameterTop | double | get | |
ProngHeight | double | get | |
ProngMode | string | get | ”ROUND” | “CUSTOM” | “CLAW”: the prong construction, as on every setting with prongs. The claw values live in the Prong section. |
ProngsRotated | bool | get | |
UpperRail | IBasketRail | get |
| Method | |
|---|---|
void Delete() | (from IParametricObject) |
void Move(Vector3d translation) | (from IParametricObject) |
void SetElement(string element) | Applies a saved Basket element (ElementsApi.List(“Basket”)) to this basket: its parameters replace the current ones, the mother gem stays, and the basket regenerates in place (same id). |
void SetProngCount(int prongs) | Parametric edits — each regenerates the basket (the group keeps its id, so this handle stays valid; the member objects are rebuilt) and calls LicenseGate.RequireValid() first. Millimetres; negative prong counts follow the tool’s rotated-variant convention. |
void SetProngDiameter(double diameter) | writes all three diameters |
void SetProngHeight(double height) | |
void SetProngMode(string mode) | ROUND | CUSTOM | CLAW (DEFAULT and CIRCLE also mean ROUND). A prong that becomes CUSTOM starts with its section turned 90 degrees (Prong.Rotation). Claw tips are built in Render mode only. Becoming CUSTOM, or CLAW from a TRIPLE, sets Prong.Type back to SINGLE. |
IBasketRail
Section.
One of the basket’s two rails. The upper rail additionally carries the chamfer; the base rail carries its vertical offset. Members that do not apply to a rail throw NotSupportedException rather than silently doing nothing.
| Property | Type | ||
|---|---|---|---|
Chamfer | bool | get | upper rail only |
ChamferOffset | double | get | upper rail only |
Enabled | bool | get | |
GemSizePercentage | double | get | rail diameter as % of the gem |
Height | double | get | mm |
HeightUnderGirdle | double | get | upper rail only |
Mode | string | get | DEFAULT (elliptical section) or CUSTOM (the CLOSED_PROFILE) |
MoveInZ | double | get | base rail only, signed |
ProfileName | string | get | CLOSED_PROFILE asset name (used in CUSTOM mode) |
Rotation | double | get | degrees, signed |
Width | double | get | mm |
| Method | |
|---|---|
void SetChamfer(bool chamfer) | upper rail only |
void SetChamferOffset(double offset) | upper rail only, signed |
void SetEnabled(bool enabled) | |
void SetGemSizePercentage(double percentage) | |
void SetHeight(double height) | |
void SetHeightUnderGirdle(double height) | upper rail only |
void SetMode(string mode) | DEFAULT (elliptical section) or CUSTOM (the rail’s CLOSED_PROFILE) |
void SetMoveInZ(double moveInZ) | base rail only, signed |
void SetProfile(string assetName) | also switches the rail to CUSTOM mode, where the profile is used |
void SetRotation(double degrees) | signed |
void SetWidth(double width) |
IBasketProng
Section.
The prongs and their support posts.
| Property | Type | ||
|---|---|---|---|
BottomRailInside | double | get | |
CapBump | double | get | mm |
ClawGemInside | double | get | The basket’s claw tip, CLAW mode only (built in Render mode only). mm the tip reaches in toward the gem. |
ClawHeight | double | get | mm added to the height over the girdle, signed |
ClawOnCurve | int | get | the panel’s “Smoothness” (1-30): on STRAIGHT prongs, where the claw starts to bend, as a % of the girdle-to-base distance; curved prongs (the default) ignore it |
ClawTension | double | get | degrees, the panel’s “Tip direction” (10-60) |
Count | int | get | negative = the rotated layout |
DiameterBottom | double | get | mm |
DiameterTop | double | get | mm |
ExtensionForManufacturing | double | get | |
GemInside | double | get | mm, signed |
Height | double | get | mm |
HeightOverGirdle | double | get | mm |
Mode | string | get | ”ROUND” | “CUSTOM” | “CLAW” (the same as IBasket.ProngMode) |
Overlap | double | get | mm the prongs of a pair, and the Triple’s middle, cross: 0 = they touch (never a gap) |
ProfileName | string | get | CLOSED_PROFILE asset name, "" when unset |
Rotation | double | get | degrees, signed |
Straight | bool | get | straight vs curved prong body |
Support | string | get | ”NONE” | “SINGLE” | “DOUBLE” |
SupportThickness | double | get | mm |
SupportWidth | double | get | mm |
Type | string | get | ”SINGLE” | “DOUBLE” | “TRIPLE”: prongs per position - one, a pair side by side, or the pair plus a thinner prong between them. ROUND prongs take all three, CLAW SINGLE or DOUBLE (the Double Claw), CUSTOM SINGLE. |
VArmLength | double | get | mm, how far each arm of the V runs along the girdle as built: the set value, or 1.2 x DiameterTop while none is set |
VProngs | bool | get | V prongs: every position on a sharp corner of the girdle (princess corners, pear and heart tips, six-prong marquise tips, trillion corners) gets a V that wraps the corner. ROUND mode only; the other positions keep their prongs. |
VThickness | double | get | mm, the V’s metal width as built: the set value, or 0.8 x DiameterTop while none is set |
| Method | |
|---|---|
void SetBottomRailInside(double value) | |
void SetCapBump(double capBump) | |
void SetClawGemInside(double gemInside) | |
void SetClawHeight(double height) | signed |
void SetClawOnCurve(int onCurve) | |
void SetClawTension(double tension) | |
void SetCount(int count) | negative = rotated; 0 = no prongs |
void SetDiameterBottom(double diameter) | |
void SetDiameterTop(double diameter) | |
void SetExtensionForManufacturing(double extension) | |
void SetGemInside(double gemInside) | signed |
void SetHeight(double height) | |
void SetHeightOverGirdle(double height) | |
void SetMode(string mode) | ROUND | CUSTOM | CLAW (DEFAULT and CIRCLE also mean ROUND); becoming CUSTOM starts Rotation at 90; becoming CUSTOM, or CLAW from a TRIPLE, sets Type back to SINGLE |
void SetOverlap(double overlap) | mm, 0 or more (0 = the prongs touch) |
void SetProfile(string assetName) | CLOSED_PROFILE asset; also switches the prongs to CUSTOM mode, where the profile is used (from another mode, Rotation starts at 90; Type goes back to SINGLE) |
void SetRotation(double degrees) | signed |
void SetStraight(bool straight) | |
void SetSupport(string support) | NONE | SINGLE | DOUBLE |
void SetSupportThickness(double thickness) | |
void SetSupportWidth(double width) | |
void SetType(string type) | SINGLE | DOUBLE | TRIPLE, within what the mode takes (see Type) |
void SetVArmLength(double armLength) | mm; 0 = back to automatic (in proportion to the prong diameter) |
void SetVProngs(bool vProngs) | V prongs on the sharp corners of the girdle (ROUND mode only) |
void SetVThickness(double thickness) | mm; 0 = back to automatic (in proportion to the prong diameter) |