Skip to content

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

Entity

Base class of everything stored in the model. Each model entity is represented by one object, so ===, Set and Map work as identity. Deleted entities keep entityId, isValid and isDeleted; their other properties throw ReferenceError until undo restores them.

readonly entityId: number

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


readonly isDeleted: boolean

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


readonly isValid: boolean

Whether the entity still exists in the model.


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

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

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"