Skip to content

.NET API

MartiniApi

Martini settings.

from ArtisanPlugin.Scripting import MartiniApi

See also the guide, Gemsets › Martini, and the Python package, ra.martini.

Methods

Method
AllIMartini handles for every object of this kind in the active document (empty when there is no document).
ByLayerIMartini 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 martini setting — four tapering prongs meeting in a point below an existing gem, with an optional upper rail and two lateral side gems — the ArtisanMartini tool, headless.
FindThe handle for id, or null when the id does not belong to an object of this kind.
ForGemIMartini handles whose mother gem is gemId (empty for Guid.Empty).
SelectedMartinis currently selected in the active doc.

All

IReadOnlyList<IMartini> MartiniApi.All()

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

Returns IReadOnlyList<IMartini>.

ByLayer

IReadOnlyList<IMartini> MartiniApi.ByLayer(string layerName)

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

ParameterTypeDefault
layerNamestringrequired

Returns IReadOnlyList<IMartini>.

Count

int MartiniApi.Count()

Number of objects of this kind in the active document.

Returns int.

Create

IMartini MartiniApi.Create(
    Guid gemId,
    double prongHeight = 0,
    double prongDiameterTop = 0,
    double prongDiameterBottom = 0,
    bool? upperRail = null,
    bool? sideGems = null,
    double sideGemSize = 0,
    string prongMode = null,
    bool? faceTangent = null,
    string prongProfileName = null,
    double railWidth = 0,
    double railHeight = 0,
    double railHeightUnderGirdle = 0,
    string railProfileName = null,
    string sideGemShape = null,
    double sideBezelWidth = 0,
    double sideDistance = 0)

Builds a martini setting — four tapering prongs meeting in a point below an existing gem, with an optional upper rail and two lateral side gems — the ArtisanMartini tool, headless. gemId must be a gem in the active document with a martini-friendly shape (any shape except TRIANGLE and COFFIN). Millimetres; 0 (or null) keeps the tool default (or the user’s saved defaults): prongHeight 5.40, prongDiameterTop 1.30, prongDiameterBottom 1.30, sideGemSize 1.40; upperRail and sideGems are both enabled by default. As in the panel, the prong “face tangent” behaviour is seeded from the gem’s symmetry unless faceTangent says otherwise. prongMode picks the prong construction: ROUND (default), CUSTOM (the prongProfileName section; a profile alone implies it) or CLAW; DEFAULT and CIRCLE also mean ROUND. Claw tips are built in Render mode only, and are shaped through the returned handle (martini.SetClawCapHeight(…) and friends), because their defaults are signed and this signature reads 0 as “keep the default”. Returns an IMartini handle to the new martini group.

ParameterTypeDefault
gemIdGuidrequired
prongHeightdouble0
prongDiameterTopdouble0
prongDiameterBottomdouble0
upperRailbool?null
sideGemsbool?null
sideGemSizedouble0
prongModestringnull
faceTangentbool?null
prongProfileNamestringnull
railWidthdouble0
railHeightdouble0
railHeightUnderGirdledouble0
railProfileNamestringnull
sideGemShapestringnull
sideBezelWidthdouble0
sideDistancedouble0

Returns IMartini.

Find

IMartini MartiniApi.Find(Guid id)

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

ParameterTypeDefault
idGuidrequired

Returns IMartini.

ForGem

IReadOnlyList<IMartini> MartiniApi.ForGem(Guid gemId)

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

ParameterTypeDefault
gemIdGuidrequired

Returns IReadOnlyList<IMartini>.

Selected

IReadOnlyList<IMartini> MartiniApi.Selected()

Martinis currently selected in the active doc.

Returns IReadOnlyList<IMartini>.

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.

IMartini

Handle — extends IGemSetting, IParametricObject.

PropertyType
ClawCapDistancedoublegetmm the claw 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
FaceTangentboolget
GemCaratWeightdoubleget(from IGemSetting)
GemMaterialstringget(from IGemSetting)
GemShapestringget(from IGemSetting)
IdGuidget(from IParametricObject)
LayerNamestringget(from IParametricObject)
MotherGemIdGuidget(from IParametricObject)
ObjectTypestringget(from IParametricObject)
PositionPoint3dget(from IParametricObject)
ProngDiameterBottomdoubleget
ProngDiameterTopdoubleget
ProngHeightdoublegetProngs (4, tapering to a point below the gem). Millimetres.
ProngModestringgetProng construction: “ROUND”, “CUSTOM” or “CLAW”. The claw values only shape the prong tips in CLAW mode, and claw tips are built in Render mode only.
SideGemSizedoubleget
SideGemsEnabledboolget
UpperRailEnabledboolgetUpper rail and lateral side gems
Method
void Delete()(from IParametricObject)
void Move(Vector3d translation)(from IParametricObject)
void SetClawCapDistance(double distance)signed
void SetClawCapHeight(double height)signed
void SetClawTipSmoothness(double smoothness)0-1
void SetClawTipWidth(double width)0-1
void SetFaceTangent(bool faceTangent)
void SetProngDiameterBottom(double diameter)
void SetProngDiameterTop(double diameter)
void SetProngHeight(double prongHeight)Parametric edits — each regenerates the martini (the group keeps its id, so this handle stays valid; the member objects are rebuilt) and calls LicenseGate.RequireValid() first. Millimetres, and unlike the Create arguments these take literal values (0 and negatives included).
void SetProngMode(string mode)ROUND | CUSTOM | CLAW (DEFAULT and CIRCLE also mean ROUND)
void SetSideGemSize(double sideGemSize)
void SetSideGemsEnabled(bool enabled)
void SetUpperRailEnabled(bool enabled)