Scripting API
Honeycomb
from ArtisanPlugin.Scripting import HoneyCombApi
The regular hexagonal lattice used for openwork pendants, pierced panels and lightened backs - the disciplined cousin of the Voronoi pattern. The tool tiles hexagons of diameter across your closed outline, keeps the segments that fall inside it, then thickens those segments into walls and extrudes them.
Create
ids = HoneyCombApi.Create(curveId, diameter = 6, thickness = 0.8, height = 0) # -> [ids]
| Parameter | Default | Meaning |
|---|---|---|
curveId | - | The existing outline the lattice fills - must be planar and closed |
diameter | 6 | Size of one hexagonal cell, mm |
thickness | 0.8 | Wall thickness, mm - 0 gives bare centre lines and no solid |
height | 0 | Wall height, mm - 0 gives flat outlines and no solid |
The curve must be closed. An open curve stops the computation with CURVE_MUST_BE_CLOSED, and a non-planar one with CURVE_MUST_BE_PLANNAR. The lattice is generated in the curve’s own plane and transformed back, so the outline can sit anywhere in space as long as it is flat. A cell diameter the outline cannot accommodate raises INVALID_PARAMETERS.
height defaults to 0, and like Voronoi the kernel stops at whichever stage your parameters reach - centre lines, thickened outlines, or extruded walls. Pass height > 0 if you want metal.
from ArtisanPlugin.Scripting import HoneyCombApi, Transaction
with Transaction.Begin("Honeycomb back"):
ids = HoneyCombApi.Create(curveId, diameter = 4, thickness = 0.5, height = 1.0)
The returned list mixes two kinds of object, exactly as the panel’s Accept does:
- The solid, when the walls resolve to a single brep: a Honeycomb smart component (
HoneyCombCustomObject, mother = your curve) on the metal layer with the document’s metal material. If the walls resolve to several disjoint solids instead, no solid is added at all - only the curves below come back. - The lattice curves, always: the centre lines or the thickened wall outlines, added to the secondary object layer (Object 02) with default attributes, not to the metal layer and with no material.
So a call with a height returns the solid and its outline curves; a call without one returns only curves. If the thickened outlines collapse to a single curve the computation raises INVALID_CURVES, and any other failure surfaces as “Honeycomb computation failed on that curve.”
Every numeric parameter follows the house 0-keeps-default convention - 0 means “use my saved Honeycomb defaults, or the tool’s” - and no -1 sentinel is needed, since 0 is not a meaningful cell size, thickness or height. Passing an id that is not a curve fails with “Object … is not a curve.” The lattice rotation angle the model carries is not exposed on this facade.
This is a licensed mutation - wrap it in a Transaction for one-step undo.