.NET API
CutterApi
The cutters that carve the seat of a stone into the metal.
from ArtisanPlugin.Scripting import CutterApi
See also the guide, Gemsets › Cutters, and the Python package, ra.cutter.
Methods
| Method | |
|---|---|
All | ICutter handles for every object of this kind in the active document (empty when there is no document). |
ByLayer | ICutter 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 one cutter per gem (the ArtisanCutters tool, headless): the cutting/drilling solid used to open the gem seat in the metal. |
Find | The handle for id, or null when the id does not belong to an object of this kind. |
ForGem | ICutter handles whose mother gem is gemId (empty for Guid.Empty). |
Selected | Cutters currently selected in the active doc. |
All
IReadOnlyList<ICutter> CutterApi.All()
ICutter handles for every object of this kind in the active document (empty when there is no document).
Returns IReadOnlyList<ICutter>.
ByLayer
IReadOnlyList<ICutter> CutterApi.ByLayer(string layerName)
ICutter handles on the layer with the given full path (empty when the layer does not exist).
| Parameter | Type | Default |
|---|---|---|
layerName | string | required |
Returns IReadOnlyList<ICutter>.
Count
int CutterApi.Count()
Number of objects of this kind in the active document.
Returns int.
Create
IReadOnlyList<ICutter> CutterApi.Create(
IEnumerable<Guid> gemIds = null,
double sizeTop = 0,
double sizeBottom = 0,
double sizeDrill = 0,
double heightTop = 0,
double heightCrown = 0,
double heightGirdle = 0,
double heightPavilion = 0,
double heightDrill = -1,
double gemInside = double.NaN,
int drillType = -1,
bool fitToGem = false,
double clearance = double.NaN)
Builds one cutter per gem (the ArtisanCutters tool, headless): the cutting/drilling solid used to open the gem seat in the metal. gemIds null/empty = the currently selected gems. Size arguments are PERCENTAGES of the gem size (the tool’s own convention), except gemInside, which is millimetres added to the gem outline (negative shrinks). Pass 0 to keep the tool default (sizeTop 40, sizeBottom 40, sizeDrill 40, heightTop 100, heightCrown 34, heightGirdle 3, heightPavilion 71). heightDrill uses -1 as “keep default (200)” because 0 is meaningful: it disables the drill body entirely. drillType -1 keeps the default; valid values are 0 = gem shape, 1 = round, 2 = square, 3 = hexagon. Same geometry as the panel: the size arguments scale the gem outline, the heights are % of the gem height, and the pavilion is a straight cone from the girdle outline to one point heightPavilion % below it. It does not follow the real pavilion of fancy cuts (cushion, oval…), where it can sit inside the stone just below the girdle: raise heightPavilion / heightGirdle or give gemInside a positive margin when the cutter must enclose the stone. fitToGem true computes gemInside, heightGirdle and heightPavilion per gem so the cutter encloses the gem’s real girdle and pavilion with clearance mm (NaN = 0.05), overriding those three arguments; the crown, top and drill stay as given. Returns one ICutter handle per gem, in input order.
| Parameter | Type | Default |
|---|---|---|
gemIds | IEnumerable<Guid> | null |
sizeTop | double | 0 |
sizeBottom | double | 0 |
sizeDrill | double | 0 |
heightTop | double | 0 |
heightCrown | double | 0 |
heightGirdle | double | 0 |
heightPavilion | double | 0 |
heightDrill | double | -1 |
gemInside | double | double.NaN |
drillType | int | -1 |
fitToGem | bool | false |
clearance | double | double.NaN |
Returns IReadOnlyList<ICutter>.
Find
ICutter CutterApi.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 ICutter.
ForGem
IReadOnlyList<ICutter> CutterApi.ForGem(Guid gemId)
ICutter handles whose mother gem is gemId (empty for Guid.Empty).
| Parameter | Type | Default |
|---|---|---|
gemId | Guid | required |
Returns IReadOnlyList<ICutter>.
Selected
IReadOnlyList<ICutter> CutterApi.Selected()
Cutters currently selected in the active doc.
Returns IReadOnlyList<ICutter>.
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.
ICutter
Handle — extends IGemSetting, IParametricObject.
| Property | Type | ||
|---|---|---|---|
DrillType | int | get | 0 gem shape, 1 round, 2 square, 3 hexagon |
GemCaratWeight | double | get | (from IGemSetting) |
GemInside | double | get | |
GemMaterial | string | get | (from IGemSetting) |
GemShape | string | get | (from IGemSetting) |
HeightCrown | double | get | |
HeightDrill | double | get | |
HeightGirdle | double | get | |
HeightPavilion | double | get | |
HeightTop | double | get | |
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) |
SizeBottom | double | get | |
SizeDrill | double | get | |
SizeTop | double | get | Sizes and heights are PERCENTAGES of the mother gem, except GemInside which is millimetres. 0 is legal for all of them (a 0 drill height means no drill body at all). |
| Method | |
|---|---|
void Delete() | (from IParametricObject) |
void FitToGem(double clearance = double.NaN) | Fit to gem: sets GemInside, HeightGirdle and HeightPavilion so the cutter encloses this gem’s real pavilion and girdle with clearance mm (NaN = 0.05). The crown, top and drill stay. Regenerates in place. |
void Move(Vector3d translation) | (from IParametricObject) |
void SetDrillType(int drillType) | 0-3 |
void SetGemInside(double gemInside) | mm, signed |
void SetHeightCrown(double heightCrown) | |
void SetHeightDrill(double heightDrill) | 0 = no drill body |
void SetHeightGirdle(double heightGirdle) | |
void SetHeightPavilion(double heightPavilion) | |
void SetHeightTop(double heightTop) | |
void SetSizeBottom(double sizeBottom) | |
void SetSizeDrill(double sizeDrill) | |
void SetSizeTop(double sizeTop) | Parametric edits — each regenerates the cutter in place (same Guid) and calls LicenseGate.RequireValid() first. These take LITERAL values, so 0 is a real 0. |