Skip to content

Scripting API

Gems by network

from ArtisanPlugin.Scripting import GemsByNetworkApi as gemsbynetwork

Where gems on curve runs a single line of stones, a gems-by-network setting fills a whole area bounded by a network of curves - the fan of stones across a cluster top, the field of pavé between two rails. The stones are laid out across the surface the network describes, kept at a common size and gap and pushed to a common depth.

Like gems on curve, the parent here is a curve, not a gem. The handle exposes CurveId and the facade has ForCurve(curveId) where the single-gem settings have ForGem(gemId). On a multi-gem object like this one, MotherGemId is empty by design.

Create

GemsByNetworkApi has no Create. The layout is built interactively in Rhino, from the gems-by-network tool, and the scripting API is a read side over the result: use it to find, inspect, move and delete networks that already exist in the document.

If you need to place stones from a script, use GemsOnCurveApi.Create for a row along one curve, or PaveApi.OnSurface to fill a surface automatically.

Edit

The network is read-only after creation: IGemsByNetwork carries no setters.

What the handle exposes for reading:

MemberMeaning
CurveIdThe parent curve the network was built from
GemSizeDiameter of each stone, mm
GemDistanceGap between stones, mm
GemMoveByZHow far the stones are pushed along the layout normal, mm

Plus the shared Id, MotherGemId (empty - the parent is the curve), ObjectType, LayerName, Position, Move(vector) and Delete(). Those two mutations belong inside a Transaction so the edit lands as one undo step.

from ArtisanPlugin.Scripting import GemsByNetworkApi as gemsbynetwork, Transaction

for n in gemsbynetwork.All():
    print(n.GemSize, n.GemDistance, n.GemMoveByZ)

with Transaction.Begin("Drop network"):
    gemsbynetwork.Selected()[0].Delete()

Queries

All(), Find(id), Count(), Selected(), ByLayer(name), ForCurve(curveId).

ForCurve returns every network built on that curve - there can be more than one.