Skip to content

.NET API

ClusterApi

Cluster settings around a centre stone.

from ArtisanPlugin.Scripting import ClusterApi

See also the guide, Gemsets › Cluster, and the Python package, ra.cluster.

Methods

Method
AllICluster handles for every object of this kind in the active document (empty when there is no document).
ByLayerICluster 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 cluster of small stones around an existing gem — the ArtisanCluster tool, headless.
FindThe handle for id, or null when the id does not belong to an object of this kind.
ForGemICluster handles whose mother gem is gemId (empty for Guid.Empty).
SelectedClusters currently selected in the active doc.

All

IReadOnlyList<ICluster> ClusterApi.All()

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

Returns IReadOnlyList<ICluster>.

ByLayer

IReadOnlyList<ICluster> ClusterApi.ByLayer(string layerName)

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

ParameterTypeDefault
layerNamestringrequired

Returns IReadOnlyList<ICluster>.

Count

int ClusterApi.Count()

Number of objects of this kind in the active document.

Returns int.

Create

ICluster ClusterApi.Create(
    Guid gemId,
    double stoneSize = 0,
    double stoneDistance = 0,
    double distanceToGem = 0,
    int prongNumber = 0,
    double prongDiameter = 0,
    double railDiameter = 0,
    bool? doubleRail = null,
    double railDiameter2 = 0,
    string prongOrientation = null,
    double internalProngDiameter = 0,
    double externalProngDiameter = 0,
    double centralProngDiameter = 0,
    double stonesZPosition = double.NaN,
    double stonesRotation = double.NaN,
    string element = null)

Builds a cluster of small stones around an existing gem — the ArtisanCluster tool, headless. gemId must be a gem in the active document with a cluster-friendly shape (ROUND, CUSHION, EMERALD, OVAL, RADIANT, ASSCHER); the kernel picks the matching shape variant internally. Millimetres; 0 keeps the tool default (or the user’s saved defaults): stoneSize 1.6, stoneDistance 0.2, distanceToGem 1.0, prongDiameter 0.8 (applied to the internal, external and central prongs alike), railDiameter 1.0. prongNumber is 3, 4 or 5 (default 4). element = name of a saved Cluster element (ElementsApi.List(“Cluster”)) to start from instead of the defaults; explicit arguments override it. Returns an ICluster handle to the new cluster group.

ParameterTypeDefault
gemIdGuidrequired
stoneSizedouble0
stoneDistancedouble0
distanceToGemdouble0
prongNumberint0
prongDiameterdouble0
railDiameterdouble0
doubleRailbool?null
railDiameter2double0
prongOrientationstringnull
internalProngDiameterdouble0
externalProngDiameterdouble0
centralProngDiameterdouble0
stonesZPositiondoubledouble.NaN
stonesRotationdoubledouble.NaN
elementstringnull

Returns ICluster.

Find

ICluster ClusterApi.Find(Guid id)

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

ParameterTypeDefault
idGuidrequired

Returns ICluster.

ForGem

IReadOnlyList<ICluster> ClusterApi.ForGem(Guid gemId)

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

ParameterTypeDefault
gemIdGuidrequired

Returns IReadOnlyList<ICluster>.

Selected

IReadOnlyList<ICluster> ClusterApi.Selected()

Clusters currently selected in the active doc.

Returns IReadOnlyList<ICluster>.

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.

ICluster

Handle — extends IGemSetting, IParametricObject.

PropertyType
CentralProngDiameterdoubleget
ClusterStoneCountintgetStones forming the cluster (around the center gem)
ClusterStoneSizedoubleget
ClusterStoneWeightdoubleget
ClusterTotalWeightdoubleget
DistanceToGemdoubleget
DoubleRailboolget
ExternalProngDiameterdoubleget
FilletFactordoubleget
GemCaratWeightdoubleget(from IGemSetting)
GemMaterialstringget(from IGemSetting)
GemShapestringget(from IGemSetting)
IdGuidget(from IParametricObject)
InternalProngDiameterdoubleget
LayerNamestringget(from IParametricObject)
MotherGemIdGuidget(from IParametricObject)
ObjectTypestringget(from IParametricObject)
PositionPoint3dget(from IParametricObject)
ProngCountintget3, 4 or 5
ProngOrientationstringget”CURVE” | “CENTER”
RailDiameter1doubleget
RailDiameter2doubleget
StoneDistancedoubleget
StoneSizedoublegetCurrent values. Millimetres / degrees; several are signed.
StonesRotationdoublegetsigned
StonesZPositiondoublegetsigned
Method
void Delete()(from IParametricObject)
void Move(Vector3d translation)(from IParametricObject)
void SetBaseHeight(double height)
void SetBaseMoveInZ(double moveInZ)signed
void SetBaseWidth(double width)
void SetCentralProngDiameter(double diameter)
void SetDistanceToGem(double distance)
void SetDoubleRail(bool enabled)
void SetElement(string element)Applies a saved Cluster element (ElementsApi.List(“Cluster”)) to this cluster: its parameters replace the current ones, the mother gem stays, and the cluster regenerates in place (same id).
void SetExternalProngDiameter(double diameter)
void SetFilletFactor(double factor)
void SetInternalProngDiameter(double diameter)
void SetProngCount(int count)3, 4 or 5
void SetProngDiameter(double diameter)all three families at once
void SetProngOrientation(string orientation)CURVE | CENTER
void SetRailDiameter1(double diameter)
void SetRailDiameter2(double diameter)
void SetRailMoveInZ1(double moveInZ)signed
void SetRailMoveInZ2(double moveInZ)signed
void SetStoneDistance(double distance)
void SetStoneSize(double size)Parametric edits — each regenerates the cluster (the group keeps its id) and calls LicenseGate.RequireValid() first. These take LITERAL values: 0 and negatives are allowed where the parameter is signed.
void SetStonesRotation(double degrees)signed
void SetStonesZPosition(double z)signed