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:
| Member | Meaning |
|---|---|
Id | The gem’s Guid |
Shape | "ROUND", "PRINCESS", "MARQUISE", … |
Material | Compound material name, e.g. "Diamond" |
CaratWeight | Carat weight |
SizeX / SizeY / SizeZ | Dimensions, mm |
Position | Origin of the gem’s plane |
Plane | The full placement plane (origin + orientation) |
LayerName | Full 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 |