Group
A placed group of entities with its own definition.
Extends
Section titled “Extends”Properties
Section titled “Properties”bounds
Section titled “bounds”
readonlybounds: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.
Inherited from
Section titled “Inherited from”definition
Section titled “definition”
readonlydefinition:ComponentDefinition
The group’s definition.
entities
Section titled “entities”
readonlyentities:Entities
The entities inside the group, in group-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”hidden
Section titled “hidden”hidden:
boolean
The element’s own hidden flag; assign inside Model.operation. Hidden ancestors are not taken into account; use Model.isDrawingElementVisible for that.
Inherited from
Section titled “Inherited from”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”isSolid
Section titled “isSolid”
readonlyisSolid:boolean
Whether the group’s geometry is a closed solid; see Entities.isSolid.
isValid
Section titled “isValid”
readonlyisValid:boolean
Whether the entity still exists in the model.
Inherited from
Section titled “Inherited from”material
Section titled “material”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
Section titled “transformation”transformation:
Transformation
Maps group-local coordinates into the parent context. Assigning replaces the transformation; do so inside Model.operation.
readonlytype:"Group"
The concrete class name, for narrowing unions such as AnyElement.
Overrides
Section titled “Overrides”visible
Section titled “visible”visible:
boolean
The inverse of hidden; assign inside Model.operation.
Inherited from
Section titled “Inherited from”volume
Section titled “volume”
readonlyvolume:number|null
The volume the group encloses, scaled by its transformation, in cubic meters, or null
when it isn’t a solid.
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”Layer | null
Set Signature
Section titled “Set Signature”set layer(
value):void
Parameters
Section titled “Parameters”Layer | null
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”makeUnique()
Section titled “makeUnique()”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.
Returns
Section titled “Returns”void
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"
Inherited from
Section titled “Inherited from”transform()
Section titled “transform()”transform(
transformation):void
Applies a transformation in the parent context, so the new transformation is
transformation.multiply(old). Call it inside Model.operation.
Parameters
Section titled “Parameters”transformation
Section titled “transformation”Returns
Section titled “Returns”void