Skip to content

Scripting API

IGem

Returned by GemApi — a gem placed in the current document. IGem is the one handle that does not extend IParametricObject: it is an intentionally narrow, self-contained surface, so scripts can only do what it allows. This is its complete member list:

MemberMeaning
IdThe gem’s Guid
Shape"ROUND", "PRINCESS", "MARQUISE", …
MaterialCompound material name, e.g. "Diamond"
CaratWeightCarat weight
SizeX / SizeY / SizeZDimensions, mm
PositionOrigin of the gem’s plane
PlaneThe full placement plane (origin + orientation)
LayerNameFull layer path
Select(on)Viewport selection state — not a document mutation (no undo record, no license gate); useful for scripts that end by highlighting their result
SetMaterial(materialName)Change the material
SetCaratWeight(caratWeight)Resize by carat, keeping shape, material, plane and layer
SetSize(sizeX, sizeY, sizeZ)Resize to explicit mm dimensions
Scale(factor)Uniform scale of the current size (factor > 0)
Move(translation)Translate by a Vector3d
SetPlane(plane)Re-place the gem: moves and orients to the given plane
Rotate(degrees)Spin around the gem’s own Z axis (positive = counter-clockwise)
Flip()Turn the gem upside down (180° around its own X axis)
Copy() / Copy(translation)Duplicate in place, or displaced by translation — returns the new IGem
Delete()Remove the gem