Skip to content

.NET API

AdvancedBasketApi

Baskets with independent prong and rail profiles.

from ArtisanPlugin.Scripting import AdvancedBasketApi

See also the guide, Gemsets › Advanced basket, and the Python package, ra.advanced_basket.

Methods

Method
AllIAdvancedBasket handles for every object of this kind in the active document (empty when there is no document).
ByLayerIAdvancedBasket 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 an advanced basket setting under an existing gem — the ArtisanAdvancedBasket tool, headless.
FindThe handle for id, or null when the id does not belong to an object of this kind.
ForGemIAdvancedBasket handles whose mother gem is gemId (empty for Guid.Empty).
PresetsThe prong layouts the tool ships for a gem shape, by name — the same list the panel draws as its preset row.
SelectedAdvanced baskets currently selected in the active doc.

All

IReadOnlyList<IAdvancedBasket> AdvancedBasketApi.All()

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

Returns IReadOnlyList<IAdvancedBasket>.

ByLayer

IReadOnlyList<IAdvancedBasket> AdvancedBasketApi.ByLayer(string layerName)

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

ParameterTypeDefault
layerNamestringrequired

Returns IReadOnlyList<IAdvancedBasket>.

Count

int AdvancedBasketApi.Count()

Number of objects of this kind in the active document.

Returns int.

Create

IReadOnlyList<IAdvancedBasket> AdvancedBasketApi.Create(
    IEnumerable<Guid> gemIds = null,
    int prongs = 0,
    string prongMode = null,
    double prongDiameter = 0,
    double prongHeight = 0,
    int? rails = null,
    double railWidth = 0,
    string profile = null,
    string preset = null,
    array<double> positions = null,
    string element = null)

Builds an advanced basket setting under an existing gem — the ArtisanAdvancedBasket tool, headless. One basket (its own group) per gem; gemIds null/empty = the currently selected gems. Unlike the basic Basket, the advanced basket is a free layout: a list of individually placed prongs plus a list of rails. This facade lays both out evenly, like the tool’s presets. Millimetres; 0/null keeps the tool default (or the user’s saved defaults): prongs 0 keeps the saved layout, or 4 prongs at the diagonals when there is none (the tool’s “4” preset); a positive count places that many prongs evenly around the gem. prongMode null = ROUND; also DOUBLE (the 2-2 presets), TRIPLE (3-3), CLAW, OFFSET or CUSTOM, applied to every prong (DEFAULT and CIRCLE also mean ROUND; claw tips are built in Render mode only and are tuned through the handle). prongDiameter 0 keeps 1.5 (sets top and bottom together), prongHeight 0 keeps 4. rails null keeps the saved rails (a fresh basket has none); 0 = no rails, 1 = one rail 1 mm under the girdle, 2 adds a second at 3.66 (the tool’s 1-rail / 2-rail presets; more keep the same spacing). railWidth 0 keeps 1.5, applied to every rail. profile names a CLOSED_PROFILE asset for the prongs (see AssetsApi.List) and switches them to CUSTOM mode unless prongMode says otherwise; null keeps each mode’s built-in section. Returns one IAdvancedBasket handle per gem, in input order. element = name of a saved AdvancedBasket element (ElementsApi.List(“AdvancedBasket”)) to start from instead of the defaults, re-seeded onto each gem; explicit arguments override it.

ParameterTypeDefault
gemIdsIEnumerable<Guid>null
prongsint0
prongModestringnull
prongDiameterdouble0
prongHeightdouble0
railsint?null
railWidthdouble0
profilestringnull
presetstringnull
positionsarray<double>null
elementstringnull

Returns IReadOnlyList<IAdvancedBasket>.

Find

IAdvancedBasket AdvancedBasketApi.Find(Guid id)

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

ParameterTypeDefault
idGuidrequired

Returns IAdvancedBasket.

ForGem

IReadOnlyList<IAdvancedBasket> AdvancedBasketApi.ForGem(Guid gemId)

IAdvancedBasket handles whose mother gem is gemId (empty for Guid.Empty).

ParameterTypeDefault
gemIdGuidrequired

Returns IReadOnlyList<IAdvancedBasket>.

Presets

IReadOnlyList<string> AdvancedBasketApi.Presets(Guid gemId)

The prong layouts the tool ships for a gem shape, by name — the same list the panel draws as its preset row. Pass one of these as Create’s preset. Names look like “4”, “4-V”, “2-2”, “3-3”, “6”, “8” or “NONE”; which ones exist depends on the shape (an emerald gets corner layouts, a marquise gets tip layouts…).

ParameterTypeDefault
gemIdGuidrequired

Returns IReadOnlyList<string>.

Selected

IReadOnlyList<IAdvancedBasket> AdvancedBasketApi.Selected()

Advanced baskets currently selected in the active doc.

Returns IReadOnlyList<IAdvancedBasket>.

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.

IAdvancedBasket

Handle — extends IGemSetting, IParametricObject.

PropertyType
ClawCapDistancedoublegetThe claw tips of CLAW prongs (built in Render mode only), first prong’s values. mm the apex is pulled in toward the gem centre.
ClawCapHeightdoublegetmm the apex moves up (+) or down (-)
ClawTipSmoothnessdoublegetbody-to-tip blend, 0-1
ClawTipWidthdoublegetapex thickness as a fraction of the prong: 0 sharp point - 1 full
GemCaratWeightdoubleget(from IGemSetting)
GemMaterialstringget(from IGemSetting)
GemShapestringget(from IGemSetting)
IdGuidget(from IParametricObject)
LayerNamestringget(from IParametricObject)
MotherGemIdGuidget(from IParametricObject)
ObjectTypestringget(from IParametricObject)
ParametersJsonstringgetEvery value of every prong and rail, as the panel’s per-prong and per-rail editors hold them: the model’s JSON, whose paths GetParameter / SetParameter take.
PositionPoint3dget(from IParametricObject)
ProngCountintgetUnlike the basic Basket, the advanced basket stores one entry per prong/rail, each with its own settings. The scalar getters report the first prong’s values (0 when there are none).
ProngDiameterdoubleget
ProngHeightdoubleget
ProngModestringget”ROUND” | “CUSTOM” | “CLAW” | “OFFSET” | “DOUBLE” | “TRIPLE” when every prong shares it, “MIXED” when the prongs differ (the panel’s per-prong editor), "" with no prongs.
RailCountintget
Method
void Delete()(from IParametricObject)
string GetParameter(string path)One value by path: “Prongs[0].Inclination”, “rails[1].fillet_radius” (case and underscores ignored); null for an unknown path.
void Move(Vector3d translation)(from IParametricObject)
void SetClawCapDistance(double distance)signed; every prong
void SetClawCapHeight(double height)signed; every prong
void SetClawTipSmoothness(double smoothness)0-1; every prong
void SetClawTipWidth(double width)0-1; every prong
void SetElement(string element)Applies a saved AdvancedBasket element (ElementsApi.List(“AdvancedBasket”)) to this basket: its prongs and rails replace the current ones, re-seeded onto the mother gem (which stays) so the layout keeps its direction on this cut, and the basket regenerates in place (same id).
void SetParameter(string path, string value)Sets one value by path, as text (“0.4”, “true”); ”[]” sets it on every prong or rail (“prongs[].gem_inside”). Enum fields take their number. edit_object sends the keys it has no setter for here.
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. The Set*Count methods rebuild the prong/rail set evenly spaced, cloning the first existing entry’s settings (tool defaults when empty); the other setters apply to every prong.
void SetProngDiameter(double diameter)
void SetProngHeight(double height)
void SetProngMode(string mode)ROUND | CUSTOM | CLAW | OFFSET | DOUBLE | TRIPLE, on every prong (DEFAULT and CIRCLE also mean ROUND)
void SetRailCount(int rails)