Skip to content

.NET API

PegheadApi

Peghead seats under a stone: prongs, height, thickness.

from ArtisanPlugin.Scripting import PegheadApi

See also the guide, Gemsets › Peghead, and the Python package, ra.peghead.

Methods

Method
AllIPeghead handles for every object of this kind in the active document (empty when there is no document).
ByLayerIPeghead 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 peghead (prong head) around an existing gem — the ArtisanPeghead tool, headless.
FindThe handle for id, or null when the id does not belong to an object of this kind.
ForGemIPeghead handles whose mother gem is gemId (empty for Guid.Empty).
SelectedPegheads currently selected in the active doc.

All

IReadOnlyList<IPeghead> PegheadApi.All()

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

Returns IReadOnlyList<IPeghead>.

ByLayer

IReadOnlyList<IPeghead> PegheadApi.ByLayer(string layerName)

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

ParameterTypeDefault
layerNamestringrequired

Returns IReadOnlyList<IPeghead>.

Count

int PegheadApi.Count()

Number of objects of this kind in the active document.

Returns int.

Create

IPeghead PegheadApi.Create(
    Guid gemId,
    int prongs = 0,
    double height = 0,
    double thickness = 0,
    double girdleWidth = 0,
    double overGirdleHeight = 0,
    double gemInside = double.NaN,
    string profile = null,
    string element = null,
    double thicknessBottom = 0,
    double prongRotation = double.NaN,
    bool? seat = null,
    double seatAngle = 0,
    bool? galleryRail = null,
    double galleryPosition = 0,
    double galleryHeight = 0,
    double galleryWidth = 0)

Builds a peghead (prong head) around an existing gem — the ArtisanPeghead tool, headless. gemId must be a gem in the active document; the peghead is a parametric child of that gem. Millimetres; 0 keeps the tool default (or the user’s saved defaults): height 5, thickness 1, girdleWidth 0.8, overGirdleHeight 1. prongs 0 keeps the default (4); use 3, 4, 6… or a negative count for the rotated variant (-4 = 4 prongs at 45 degrees). gemInside defaults to 0 and accepts negatives. profile picks a PEGHEAD_PROFILE asset by name (see AssetsApi.List(“PEGHEAD_PROFILE”)); omitted = the default profile. thicknessBottom tapers the prongs: thickness is the one at the top and this the one at the bottom of the peghead (0 = the same, no taper). prongRotation turns the prongs around the axis of the stone, in degrees from the positions the shape gives them (counter-clockwise seen from above; default 0). seat true cuts the seat of the stone into the prongs: what the stone occupies is taken out of them, straight above the girdle and at seatAngle below it (degrees from the girdle plane, default 41). It shows where the stone sits inside the prongs (gemInside above 0). galleryRail true adds a rail around the peghead, under the stone, that ties the prongs together: galleryPosition mm below the girdle (0 = a little above the middle of the body), galleryHeight high and galleryWidth wide (0 = 0.8 mm each). element = name of a saved Peghead element (ElementsApi.List(“Peghead”)) to start from instead of the defaults; explicit arguments (profile included) override it.

ParameterTypeDefault
gemIdGuidrequired
prongsint0
heightdouble0
thicknessdouble0
girdleWidthdouble0
overGirdleHeightdouble0
gemInsidedoubledouble.NaN
profilestringnull
elementstringnull
thicknessBottomdouble0
prongRotationdoubledouble.NaN
seatbool?null
seatAngledouble0
galleryRailbool?null
galleryPositiondouble0
galleryHeightdouble0
galleryWidthdouble0

Returns IPeghead.

Find

IPeghead PegheadApi.Find(Guid id)

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

ParameterTypeDefault
idGuidrequired

Returns IPeghead.

ForGem

IReadOnlyList<IPeghead> PegheadApi.ForGem(Guid gemId)

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

ParameterTypeDefault
gemIdGuidrequired

Returns IReadOnlyList<IPeghead>.

Selected

IReadOnlyList<IPeghead> PegheadApi.Selected()

Pegheads currently selected in the active doc.

Returns IReadOnlyList<IPeghead>.

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.

IPeghead

Handle — extends IGemSetting, IParametricObject.

PropertyType
GalleryHeightdoubleget
GalleryPositiondoublegetThe gallery rail, in mm: how far below the girdle its middle is (0 = a little above the middle of the body), its height and its width.
GalleryRailboolgetTrue when the peghead has a gallery rail tying the prongs together.
GalleryWidthdoubleget
GemCaratWeightdoubleget(from IGemSetting)
GemInsidedoubleget
GemMaterialstringget(from IGemSetting)
GemShapestringget(from IGemSetting)
GirdleWidthdoubleget
Heightdoubleget
IdGuidget(from IParametricObject)
LayerNamestringget(from IParametricObject)
MotherGemIdGuidget(from IParametricObject)
ObjectTypestringget(from IParametricObject)
OverGirdleHeightdoubleget
PositionPoint3dget(from IParametricObject)
ProfileNamestringgetPEGHEAD_PROFILE asset name, "" when unset
ProngRotationdoublegetDegrees the prongs are turned around the axis of the stone, from the positions the shape gives them (counter-clockwise from above).
ProngsintgetCurrent values (millimetres, except Prongs). negative = the rotated variant
SeatboolgetTrue when the seat of the stone is cut into the prongs.
SeatAngledoublegetAngle of the seat below the girdle, in degrees from the girdle plane.
Thicknessdoubleget
ThicknessBottomdoublegetThickness of the prongs at the bottom of the peghead, in mm (Thickness is the one at the top). 0 = the same: no taper.
Method
void Delete()(from IParametricObject)
void Move(Vector3d translation)(from IParametricObject)
void SetElement(string element)Applies a saved Peghead element (ElementsApi.List(“Peghead”)) to this peghead: its parameters replace the current ones, the mother gem stays, and the peghead regenerates in place (same Guid).
void SetGalleryHeight(double galleryHeight)Height of the gallery rail, in mm.
void SetGalleryPosition(double galleryPosition)How far below the girdle the middle of the gallery rail is, in mm. 0 = a little above the middle of the body.
void SetGalleryRail(bool galleryRail)Adds (true) or removes (false) the gallery rail, the ring under the stone that ties the prongs together.
void SetGalleryWidth(double galleryWidth)Width of the gallery rail, in mm, measured in from the outside of the peghead.
void SetGemInside(double gemInside)
void SetGirdleWidth(double girdleWidth)
void SetHeight(double height)
void SetOverGirdleHeight(double overGirdleHeight)
void SetProfile(string assetName)PEGHEAD_PROFILE asset name
void SetProngRotation(double prongRotation)Turns the prongs around the axis of the stone: degrees from the positions the shape gives them, counter-clockwise seen from above.
void SetProngs(int prongs)Parametric edits — each regenerates the peghead in place (same Guid) and calls LicenseGate.RequireValid() first. Millimetres; prongs accepts negative counts for the rotated variant (-4 = 4 prongs at 45 degrees).
void SetSeat(bool seat)Cuts (true) or removes (false) the seat of the stone in the prongs: what the stone occupies is taken out of them. It shows where the stone sits inside the prongs (GemInside above 0).
void SetSeatAngle(double seatAngle)Angle of the seat below the girdle: 10 to 80 degrees from the girdle plane (41 = a brilliant’s pavilion).
void SetThickness(double thickness)
void SetThicknessBottom(double thicknessBottom)Tapers the prongs: their thickness at the bottom of the peghead, in mm, Thickness staying the one at the top. 0 removes the taper.