Scripting API
Gems map
from ArtisanPlugin.Scripting import DraftingApi as drafting
The gems map is the stone chart the setter works from: every gem in the document flattened onto a 2D drawing as a coloured circle with its size written beside it, so the bench can see at a glance which stone goes where and in what size. The tool projects each gem’s position, draws the circle, the hatch and the label, and leaves the lot in the document - the same drawing the ArtisanGemsMap command makes, without its pick prompt.
Usage
drafting.CreateGemsMap(point, scale = 2, spherical = False, expandOverlapping = False)
| Parameter | Default | Meaning |
|---|---|---|
point | - | Point3d the map is centred on (the command’s pick) |
scale | 2 | Drawing scale factor; valid range 0.01 to 10 |
spherical | False | False = planar projection; True = spherical, for stones wrapped around a curved surface |
expandOverlapping | False | True pushes overlapping circles apart so every label stays readable |
Note that scale here does not follow the usual “0 keeps the tool default” convention: 0 is out of range and throws. Pass the command default 2 explicitly, or any value between 0.01 and 10.
Returns nothing (void). The result is the geometry it added to the active document: curves, texts and hatches, all placed in a Rhino group named GEMS_MAP. That group name is how you find the map afterwards - select it, move it, or delete it as a unit before drawing a fresh one, since each call adds another map rather than replacing the previous one. The views are redrawn on the way out.
With no gems in the document it draws nothing and says so on the command line, exactly like the command - it does not throw.
Out-of-range scale throws ArgumentOutOfRangeException: “Scale must be between 0.01 and 10.”
The map is document geometry, so wrap the call in a Transaction when you want a one-step undo alongside the rest of your script.