Skip to content

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

Text

A text label. Leader text is pinned to a point and shows its label at point plus leader, joined by a leader line when leader isn’t zero. Screen text stays at a fixed place on the screen. A label pinned to a vertex moves with it when an edit moves the vertex.

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 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 isScreenText: boolean

Whether this is screen text.


readonly isValid: boolean

Whether the entity still exists in the model.

DrawingElement.isValid


readonly leader: Vector3d

From the pinned point to the label; the zero vector when the label sits on the point.


readonly point: Point3d

The point the label is pinned to, in its context’s coordinates; the origin for screen text.


readonly screenPosition: { x: number; y: number; } | null

For screen text, fractions of the view’s width and height from its top-left corner; otherwise null.


readonly type: "Text"

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

DrawingElement.type


visible: boolean

The inverse of hidden; assign inside Model.operation.

DrawingElement.visible

get color(): Color

The color of the label’s text and leader: red, green, blue and alpha, each from 0 to 1. Assigning accepts a color without a; the color must be opaque.

Color

set color(value): void

Color | { a?: number; b: number; g: number; r: number; }

void


get font(): string

The label’s font id: "" for Modlumi’s default face, "source-serif-4" or "source-code-pro" for the other bundled faces, or "system/<family>/<style>", as in "system/Arial/Bold", for a face installed on the computer. A label whose face isn’t installed keeps its font id and shows in the default face.

string

set font(value): void

string

void


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


get size(): number

The label’s text size in pixels, from 4 to 400. Labels keep their size on the screen however far away they are. New labels are 14 pixels.

number

set size(value): void

number

void


get text(): string

The label. Assigning an empty string throws.

string

set text(value): void

string

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