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 along one curve, gems by network fills a whole network of intersecting curves - the fan of stones across a cluster top, a lattice of pavé between rails - sizing the stones so they meet at the nodes. It is the Gems by Network tool, run from a script.

Create

gemsbynetwork.Create(curveIds=None, gemSize=0, minDistance=0, moveInZ=NaN, fitToEnd=None)
ParameterMeaning
curveIdsThe curves of the network (any Rhino curves). None or empty uses the current selection
gemSizeStone diameter, mm
minDistanceMinimum metal between stones, mm
moveInZRaises (or, negative, lowers) the stones off the curves, mm
fitToEndTrue stretches each run so a stone lands on each curve end

Millimetres. 0 - or leaving an argument out - keeps the default: your saved Gems on Network defaults when there are any, otherwise the tool’s (gemSize 1.0, minDistance 0.1, moveInZ 0, so the stones sit on the curves).

Create returns the ids of the gems it baked:

from ArtisanPlugin.Scripting import GemsByNetworkApi as gemsbynetwork, Transaction

with Transaction.Begin("Network pave"):
    ids = gemsbynetwork.Create(curve_ids, gemSize=1.2, minDistance=0.15)
print(len(ids), "stones")

After creation

Gems by network is not a parametric type. The stones are baked as loose gems in a plain group: there is no handle to list, find or regenerate, and ArtisanEdit doesn’t reopen the layout. To change the stones, edit them one by one like any other gem with GemApi - its handles take size, material, position and the rest - or delete the group and run Create again with new values.

Over MCP, the same tool is gems_on_network.