.NET API
TulipApi
Tulip settings.
from ArtisanPlugin.Scripting import TulipApi
See also the guide, Gemsets › Tulip, and the Python package, ra.tulip.
Methods
| Method | |
|---|---|
All | ITulip handles for every object of this kind in the active document (empty when there is no document). |
ByLayer | ITulip 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 tulip setting — petal-shaped SubD prongs holding an existing gem — the ArtisanTulip tool, headless. |
Find | The handle for id, or null when the id does not belong to an object of this kind. |
ForGem | ITulip handles whose mother gem is gemId (empty for Guid.Empty). |
Selected | Tulips currently selected in the active doc. |
All
IReadOnlyList<ITulip> TulipApi.All()
ITulip handles for every object of this kind in the active document (empty when there is no document).
Returns IReadOnlyList<ITulip>.
ByLayer
IReadOnlyList<ITulip> TulipApi.ByLayer(string layerName)
ITulip handles on the layer with the given full path (empty when the layer does not exist).
| Parameter | Type | Default |
|---|---|---|
layerName | string | required |
Returns IReadOnlyList<ITulip>.
Count
int TulipApi.Count()
Number of objects of this kind in the active document.
Returns int.
Create
ITulip TulipApi.Create(
Guid gemId,
int prongCount = 0,
double pipeDiameter = 0,
double height = 0,
double bulgeWidth = 0,
string mode = null,
string ornament = null,
string ornamentPlacement = null,
double ornamentDiameter = 0,
double gemInside = double.NaN,
double moveInZ = double.NaN,
double bulgeInside = double.NaN,
double bulgeSpread = 0,
double capDistanceToCenter = double.NaN,
double capHeight = double.NaN,
double tipWidth = 0,
string prongMode = null)
Builds a tulip setting — petal-shaped SubD prongs holding an existing gem — the ArtisanTulip tool, headless. gemId must be a gem in the active document; any shape works. On asymmetric stones (oval, marquise, …) the ornament placement defaults to the X axis with per-axis leaf editing, exactly like the panel. 0 keeps the tool default (or the user’s saved defaults): prongCount 4 (valid values 4 or 6), pipeDiameter 1.15 mm, height 1.7 (a vertical SCALE FACTOR of the whole setting, not mm), bulgeWidth 1.5 (multiplier on the reference tangential bow). prongMode is ROUND (default) or CLAW (mode is its older name; DEFAULT and CIRCLE also mean ROUND); claw tips are built in Render mode only and shaped by capDistanceToCenter, capHeight and tipWidth here or the handle’s Claw* setters. ornament is NONE (default), UNION or LEAF. Returns an ITulip handle to the new tulip group.
| Parameter | Type | Default |
|---|---|---|
gemId | Guid | required |
prongCount | int | 0 |
pipeDiameter | double | 0 |
height | double | 0 |
bulgeWidth | double | 0 |
mode | string | null |
ornament | string | null |
ornamentPlacement | string | null |
ornamentDiameter | double | 0 |
gemInside | double | double.NaN |
moveInZ | double | double.NaN |
bulgeInside | double | double.NaN |
bulgeSpread | double | 0 |
capDistanceToCenter | double | double.NaN |
capHeight | double | double.NaN |
tipWidth | double | 0 |
prongMode | string | null |
Returns ITulip.
Find
ITulip TulipApi.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 ITulip.
ForGem
IReadOnlyList<ITulip> TulipApi.ForGem(Guid gemId)
ITulip handles whose mother gem is gemId (empty for Guid.Empty).
| Parameter | Type | Default |
|---|---|---|
gemId | Guid | required |
Returns IReadOnlyList<ITulip>.
Selected
IReadOnlyList<ITulip> TulipApi.Selected()
Tulips currently selected in the active doc.
Returns IReadOnlyList<ITulip>.
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.
ITulip
Handle — extends IGemSetting, IParametricObject.
| Property | Type | ||
|---|---|---|---|
BulgeWidth | double | get | the model’s DepthBulge |
ClawCapDistance | double | get | The claw tips, CLAW mode only (built in Render mode only), under the names the other settings use. The cap distance (in toward the gem centre) and height (up/down) scale with the stone: mm at the tulip’s reference size. |
ClawCapHeight | double | get | |
ClawTipLength | double | get | length of the claw tip, times the tube diameter (default 1) |
ClawTipSmoothness | double | get | body-to-tip blend, 0-1 (the panel leaves it at 0) |
ClawTipWidth | double | get | apex thickness as a fraction of the petal tube: 0 sharp point - 1 full |
GemCaratWeight | double | get | (from IGemSetting) |
GemInside | double | get | signed |
GemMaterial | string | get | (from IGemSetting) |
GemShape | string | get | (from IGemSetting) |
Height | double | get | vertical scale factor (not mm) |
Id | Guid | get | (from IParametricObject) |
LayerName | string | get | (from IParametricObject) |
Mode | string | get | ”Round” or “Claw” (older name of ProngMode) |
MotherGemId | Guid | get | (from IParametricObject) |
MoveInZ | double | get | signed |
ObjectType | string | get | (from IParametricObject) |
Ornament | string | get | ”None”, “Union” or “Leaf” |
OrnamentPlacement | string | get | ”AXIS_X”, “AXIS_Y” or “BOTH” |
PipeDiameter | double | get | mm |
Position | Point3d | get | (from IParametricObject) |
ProngCount | int | get | Petal prongs holding the center gem 4 or 6 |
ProngMode | string | get | ”ROUND” or “CLAW”, as on every setting with prongs |
| Method | |
|---|---|
void Delete() | (from IParametricObject) |
void Move(Vector3d translation) | (from IParametricObject) |
void SetBulgeCloseBottom(double close) | |
void SetBulgeCloseTop(double close) | |
void SetBulgeInside(double bulgeInside) | signed |
void SetBulgeSpread(double spread) | |
void SetBulgeWidth(double bulgeWidth) | the model’s DepthBulge |
void SetCapDistanceToCenter(double distance) | Older names of SetClawCapDistance, SetClawCapHeight and SetClawTipWidth. |
void SetCapHeight(double height) | |
void SetClawCapDistance(double distance) | signed |
void SetClawCapHeight(double height) | signed |
void SetClawTipLength(double length) | > 0 |
void SetClawTipSmoothness(double smoothness) | 0-1 |
void SetClawTipWidth(double width) | 0-1 |
void SetExtensionForManufacturing(double extension) | |
void SetGemInside(double gemInside) | signed |
void SetHeight(double height) | scale factor, > 0 |
void SetMode(string mode) | older name of SetProngMode |
void SetMoveInZ(double moveInZ) | signed |
void SetOrnament(string ornament) | NONE | UNION | LEAF |
void SetOrnamentDiameter(double diameter) | |
void SetOrnamentPlacement(string placement) | AXIS_X | AXIS_Y | BOTH |
void SetPipeDiameter(double pipeDiameter) | Parametric edits — each regenerates the tulip (the group keeps its id, so this handle stays valid; the member objects are rebuilt) and calls LicenseGate.RequireValid() first. LITERAL values: 0 and negatives are allowed where the parameter is signed. mm |
void SetProngCount(int count) | 4 or 6 |
void SetProngMode(string mode) | ROUND | CLAW (DEFAULT and CIRCLE also mean ROUND) |
void SetTipWidth(double width) |