.NET API
MartiniApi
Martini settings.
from ArtisanPlugin.Scripting import MartiniApi
See also the guide, Gemsets › Martini, and the Python package, ra.martini.
Methods
| Method | |
|---|---|
All | IMartini handles for every object of this kind in the active document (empty when there is no document). |
ByLayer | IMartini 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 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. |
Find | The handle for id, or null when the id does not belong to an object of this kind. |
ForGem | IMartini handles whose mother gem is gemId (empty for Guid.Empty). |
Selected | Martinis 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).
| Parameter | Type | Default |
|---|---|---|
layerName | string | required |
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.
| Parameter | Type | Default |
|---|---|---|
gemId | Guid | required |
prongHeight | double | 0 |
prongDiameterTop | double | 0 |
prongDiameterBottom | double | 0 |
upperRail | bool? | null |
sideGems | bool? | null |
sideGemSize | double | 0 |
prongMode | string | null |
faceTangent | bool? | null |
prongProfileName | string | null |
railWidth | double | 0 |
railHeight | double | 0 |
railHeightUnderGirdle | double | 0 |
railProfileName | string | null |
sideGemShape | string | null |
sideBezelWidth | double | 0 |
sideDistance | double | 0 |
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.
| Parameter | Type | Default |
|---|---|---|
id | Guid | required |
Returns IMartini.
ForGem
IReadOnlyList<IMartini> MartiniApi.ForGem(Guid gemId)
IMartini handles whose mother gem is gemId (empty for Guid.Empty).
| Parameter | Type | Default |
|---|---|---|
gemId | Guid | required |
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.
| Property | Type | ||
|---|---|---|---|
ClawCapDistance | double | get | mm the claw apex is pulled in toward the gem centre |
ClawCapHeight | double | get | mm the apex moves up (+) or down (-) |
ClawTipSmoothness | double | get | body-to-tip blend, 0-1 |
ClawTipWidth | double | get | apex thickness as a fraction of the prong: 0 sharp point - 1 full |
FaceTangent | bool | 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) |
ProngDiameterBottom | double | get | |
ProngDiameterTop | double | get | |
ProngHeight | double | get | Prongs (4, tapering to a point below the gem). Millimetres. |
ProngMode | string | get | Prong 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. |
SideGemSize | double | get | |
SideGemsEnabled | bool | get | |
UpperRailEnabled | bool | get | Upper 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) |