ComponentDefinition
Shared geometry that groups and component instances place in the model.
Extends
Section titled “Extends”Properties
Section titled “Properties”entities
Section titled “entities”
readonlyentities:Entities
The definition’s own entities, in definition-local coordinates.
entityId
Section titled “entityId”
readonlyentityId:number
Identifier that stays the same for the entity’s lifetime, including across undo and redo.
Inherited from
Section titled “Inherited from”facingCamera
Section titled “facingCamera”facingCamera:
boolean
Whether views turn each instance about its own blue (Z) axis, through its origin, so its -Y side faces the camera, like a cardboard scale figure. Only component instances turn; the stored transformations never change. Assign inside Model.operation.
isDeleted
Section titled “isDeleted”
readonlyisDeleted:boolean
Whether the entity was deleted, for example by an edit or by undo.
Inherited from
Section titled “Inherited from”isValid
Section titled “isValid”
readonlyisValid:boolean
Whether the entity still exists in the model.
Inherited from
Section titled “Inherited from”name:
string
Definition name, shared by all its instances; assign inside Model.operation.
readonlytype:"ComponentDefinition"
The concrete class name, for narrowing unions such as AnyElement.
Overrides
Section titled “Overrides”Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”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" }.
Returns
Section titled “Returns”object
entityId
Section titled “entityId”entityId:
number
optionalname?:string
type:
"Material"|"Vertex"|"Edge"|"Face"|"Loop"|"EdgeUse"|"Curve"|"ArcCurve"|"ComponentDefinition"|"ComponentInstance"|"Group"|"Layer"|"Guide"|"Text"|"LinearDimension"|"SectionPlane"