Skip to content

Vibe coding a plugin? Teach your agent Modlumi first. Works with Claude Code, Codex, Cursor and more.

Group

A placed group of entities with its own definition.

readonly bounds: BoundingBox | null

The element’s bounds in its context’s coordinates, or null when it has no geometry. A group’s or instance’s bounds enclose its transformed contents and may be a little larger than they are.

DrawingElement.bounds


readonly definition: ComponentDefinition

The group’s definition.


readonly entities: Entities

The entities inside the group, in group-local coordinates.


readonly entityId: number

Identifier that stays the same for the entity’s lifetime, including across undo and redo.

DrawingElement.entityId


hidden: boolean

The element’s own hidden flag; assign inside Model.operation. Hidden ancestors are not taken into account; use Model.isDrawingElementVisible for that.

DrawingElement.hidden


readonly isDeleted: boolean

Whether the entity was deleted, for example by an edit or by undo.

DrawingElement.isDeleted


readonly isSolid: boolean

Whether the group’s geometry is a closed solid; see Entities.isSolid.


readonly isValid: boolean

Whether the entity still exists in the model.

DrawingElement.isValid


material: Material | null

The material applied to the whole group, which faces without their own show, or null. Assign a material of this model, or null, inside Model.operation.


name: string

Group name; assign inside Model.operation.


transformation: Transformation

Maps group-local coordinates into the parent context. Assigning replaces the transformation; do so inside Model.operation.


readonly type: "Group"

The concrete class name, for narrowing unions such as AnyElement.

DrawingElement.type


visible: boolean

The inverse of hidden; assign inside Model.operation.

DrawingElement.visible


readonly volume: number | null

The volume the group encloses, scaled by its transformation, in cubic meters, or null when it isn’t a solid.

get layer(): Layer | null

The layer the element is on, or null for the default layer; assign inside Model.operation. A hidden layer hides the element whatever hidden says. Needs the "layers" feature.

Layer | null

set layer(value): void

Layer | null

void

DrawingElement.layer

makeUnique(): void

Gives the group a definition of its own when copies share it, so editing its entities leaves the copies alone. Call it inside Model.operation.

void


toJSON(): object

JSON.stringify writes the entity as its type and entityId, plus its name when it has one, such as { "type": "Group", "entityId": 12, "name": "Wheel" }.

object

entityId: number

optional name?: string

type: "Material" | "Vertex" | "Edge" | "Face" | "Loop" | "EdgeUse" | "Curve" | "ArcCurve" | "ComponentDefinition" | "ComponentInstance" | "Group" | "Layer" | "Guide" | "Text" | "LinearDimension" | "SectionPlane"

DrawingElement.toJSON


transform(transformation): void

Applies a transformation in the parent context, so the new transformation is transformation.multiply(old). Call it inside Model.operation.

Transformation

void