Model
The document the script runs against. Get it from activeModel.
Properties
Section titled “Properties”activeEntities
Section titled “activeEntities”
readonlyactiveEntities:Entities
The entities of the context being edited, such as an open group.
activeView
Section titled “activeView”
readonlyactiveView:View
The view for image export.
definitions
Section titled “definitions”
readonlydefinitions: readonlyComponentDefinition[]
All component and group definitions.
entities
Section titled “entities”
readonlyentities:Entities
The entities at the model root.
materials
Section titled “materials”
readonlymaterials: readonlyMaterial[]
All materials.
selection
Section titled “selection”
readonlyselection:Selection
The current selection.
Methods
Section titled “Methods”isDrawingElementVisible()
Section titled “isDrawingElementVisible()”isDrawingElementVisible(
path,options?):boolean
Whether an element is visible, taking hidden ancestors into account. path lists the
element’s ancestors from the model root down to the element itself.
Parameters
Section titled “Parameters”readonly DrawingElement[]
options?
Section titled “options?”Returns
Section titled “Returns”boolean
operation()
Section titled “operation()”operation<
T>(name,body):T
Runs body as one named undo step and returns its result. Every edit must happen
inside an operation. A thrown error, or any failed edit inside body (even when
caught), rolls the whole operation back. Empty operations add no undo step.
Operations can’t be nested, and body must be synchronous.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”string
() => T
Returns
Section titled “Returns”T
redo()
Section titled “redo()”redo():
void
Redoes the last undone operation. Not allowed inside an operation.
Returns
Section titled “Returns”void
undo()
Section titled “undo()”undo():
void
Undoes the last operation. Not allowed inside an operation.
Returns
Section titled “Returns”void