Group
A container that collects geometry into a single, movable unit.
Groups let you organize edges, faces, and other entities so they can be selected, moved, copied, and edited as one object. Unlike component instances, each group is unique — editing one group never affects another. Groups are ideal for temporary or one-off clusters of geometry that don’t need to be reused across the model.
When the user double-clicks a group in SketchUp, they enter its “edit context”
and can modify the geometry inside. From the API, you can read a group’s
entities using group.entities.get() or create new geometry inside a group
during an operation with methods like createFace(groupRef, ...).
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();let { Transformation } = SketchUpApi;
// Create a group with a simple box inside.await model.performOperation(op => { const g = op.createGroup(model); // Floor op.createFace(g, [ [0,0,0], [48,0,0], [48,48,0], [0,48,0] ]); // Back wall op.createFace(g, [ [0,0,0], [0,0,24], [48,0,24], [48,0,0] ]); op.groupSetName(g, 'Simple Box'); op.drawingElementsApplyTransformation( g, Transformation.translation([100, 50, 0]) );}, 'Create named group');
// Query it back and inspect its properties.let groups = await model.entities.get({ filterBy: { types: ['Group'] }});let box = groups[0];console.log(box.name);// => Simple Boxconsole.log(box.transform.origin.toArray());// => [100, 50, 0]let entities = await box.entities.get();console.log(entities.length);// => 2 (two faces)Extends
Section titled “Extends”BaseDrawingElement
Properties
Section titled “Properties”attributes
Section titled “attributes”
readonlyattributes:Attributes
The attribute dictionaries attached to this element. Attributes store custom key-value metadata that extensions can read and write.
Inherited from
Section titled “Inherited from”BaseDrawingElement.attributes
castsShadows
Section titled “castsShadows”
readonlycastsShadows:boolean
Whether this element casts shadows onto other geometry.
Inherited from
Section titled “Inherited from”BaseDrawingElement.castsShadows
definitionId
Section titled “definitionId”
readonlydefinitionId:number
The persistent ID of the underlying component definition that stores this group’s geometry. Every group is backed by a hidden definition.
description
Section titled “description”
readonlydescription:string|undefined
A longer text description of this group. Not commonly used — most groups
rely on name alone. May be undefined.
gluedToId
Section titled “gluedToId”
readonlygluedToId:SketchupId|undefined
If this group is glued to a face (like a window on a wall), this is the ID
of the entity it’s glued to. Most groups are not glued, so this is typically
undefined.
readonlyguid:string|undefined
A globally unique identifier for this group, persisted across file saves.
Useful for linking groups to external data sources. May be undefined.
hidden
Section titled “hidden”
readonlyhidden:boolean
Whether this element is hidden. Hidden elements don’t appear in the viewport unless the user enables “View > Hidden Geometry.”
Inherited from
Section titled “Inherited from”BaseDrawingElement.hidden
readonlyid:number
The persistent ID that uniquely identifies this group instance.
locked
Section titled “locked”
readonlylocked:boolean
Whether this group is locked, preventing the user from selecting or editing it in the SketchUp UI. Locked groups can still be queried and modified via the API.
materialRef
Section titled “materialRef”
readonlymaterialRef:MaterialRef|undefined
A reference to the material applied to this element, if any. Call
getMaterial() to fetch the full Material object with color and texture data.
Inherited from
Section titled “Inherited from”BaseDrawingElement.materialRef
readonlyname:string|undefined
The display name assigned to this group, like “Box” or “Wall Assembly”. May
be undefined if the group was never named.
receivesShadows
Section titled “receivesShadows”
readonlyreceivesShadows:boolean
Whether this element receives shadows cast by other geometry.
Inherited from
Section titled “Inherited from”BaseDrawingElement.receivesShadows
tagRef
Section titled “tagRef”
readonlytagRef:TagRef|undefined
A reference to the tag (formerly “layer”) assigned to this element. Call
getTag() to fetch the full Tag object.
Inherited from
Section titled “Inherited from”BaseDrawingElement.tagRef
transform
Section titled “transform”
readonlytransform:Transformation
The transformation matrix that positions and orients this group in 3D space. Encodes translation, rotation, and scale relative to the parent context.
readonlytype:Group=EntityType.Group
Accessors
Section titled “Accessors”definition
Section titled “definition”Get Signature
Section titled “Get Signature”get definition():
ComponentDefinitionRef
A reference to the hidden component definition that stores this group’s
geometry. Every group is backed by a unique definition, but this is an
implementation detail — you typically won’t need to access it directly. Use
entities to read or modify the group’s contents instead.
SDK 2.17.0
Returns
Section titled “Returns”entities
Section titled “entities”Get Signature
Section titled “Get Signature”get entities():
CallableEntities
The entities collection for this group. Use entities.get() to query faces,
edges, nested groups, and other geometry inside this group. You can also call
specialized methods like entities.getCurves() or
entities.getActiveSectionPlane().
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();let groups = await model.entities.get({ filterBy: { types: ['Group'] },});let group = groups[0];
// Get all faces inside the grouplet faces = await group.entities.get({ filterBy: { types: ['Face'] }});console.log(faces.length);Returns
Section titled “Returns”sketchupId
Section titled “sketchupId”Get Signature
Section titled “Get Signature”get sketchupId():
SketchupId
JS API identifier for this group. Pass it to API methods that accept a sketchupId.
Returns
Section titled “Returns”Overrides
Section titled “Overrides”BaseDrawingElement.sketchupId
typeName
Section titled “typeName”Get Signature
Section titled “Get Signature”get typeName():
string
Returns a named variant of the type field.
SDK 2.35.0
Returns
Section titled “Returns”string
Methods
Section titled “Methods”getBounds()
Section titled “getBounds()”getBounds():
Promise<BoundingBox>
Fetches the axis-aligned bounding box for this element from SketchUp.
Returns
Section titled “Returns”Promise<BoundingBox>
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();let all = await model.entities.get();let element = all[0];let box = await element.getBounds();console.log(box.min.x, box.min.y, box.min.z);console.log(box.max.x, box.max.y, box.max.z);SDK 2.30.0
Inherited from
Section titled “Inherited from”BaseDrawingElement.getBounds
getMaterial()
Section titled “getMaterial()”getMaterial():
Promise<Material|undefined>
Fetches the material applied to this element. Returns undefined if the
element uses the default material.
Returns
Section titled “Returns”Promise<Material | undefined>
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();let all = await model.entities.get();let element = all[0];let mat = await element.getMaterial();if (mat) { console.log(mat.name, mat.color.toHex());}SDK 2.30.0
Inherited from
Section titled “Inherited from”BaseDrawingElement.getMaterial
getTag()
Section titled “getTag()”getTag():
Promise<Tag|undefined>
Fetches the tag assigned to this element. Most elements have a tag — even
those on the default “Untagged” tag. Returns undefined only if the tag
reference is missing.
Returns
Section titled “Returns”Promise<Tag | undefined>
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();let all = await model.entities.get();let element = all[0];let tag = await element.getTag();if (tag) { console.log(tag.name);}SDK 2.30.0
Inherited from
Section titled “Inherited from”BaseDrawingElement.getTag
refresh()
Section titled “refresh()”refresh():
Promise<Group>
Re-fetches this group from SketchUp to get its current state. Because Group
is a snapshot, it can become stale if the model changes (for example, if the
user moves or renames the group). Call refresh() to get an up-to-date copy.
Returns
Section titled “Returns”Promise<Group>
A new Group reflecting the current model state. Throws if the group has been deleted.
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();let groups = await model.entities.get({ filterBy: { types: ['Group'] },});// Later, after the user makes changes...let fresh = await groups[0].refresh();console.log(fresh.name, fresh.locked);toString()
Section titled “toString()”toString():
string
Returns a string representation of an object.
Returns
Section titled “Returns”string
Deprecated
Section titled “Deprecated”materialId
Section titled “materialId”
readonlymaterialId:number|undefined
Inherited from
Section titled “Inherited from”BaseDrawingElement.materialId
readonlytagId:number|undefined
Inherited from
Section titled “Inherited from”BaseDrawingElement.tagId
bounds
Section titled “bounds”Get Signature
Section titled “Get Signature”get bounds():
Promise<BoundingBox>
Returns
Section titled “Returns”Promise<BoundingBox>
Inherited from
Section titled “Inherited from”BaseDrawingElement.bounds
Get Signature
Section titled “Get Signature”get tag():
Promise<Readonly<Tag> |undefined>
Returns
Section titled “Returns”Promise<Readonly<Tag> | undefined>
Inherited from
Section titled “Inherited from”BaseDrawingElement.tag
componentInstances()
Section titled “componentInstances()”componentInstances(
filter?):Promise<readonlyComponentInstance[]>
Query to find the componentInstances for this group
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
|
|
|
|
Returns
Section titled “Returns”Promise<readonly ComponentInstance[]>
a promise containing a snapshot of the componentInstances for this group
constructionLines()
Section titled “constructionLines()”constructionLines(
filter?):Promise<readonlyConstructionLine[]>
Query to find the constructionLines for this group
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
|
|
|
|
Returns
Section titled “Returns”Promise<readonly ConstructionLine[]>
a promise containing a snapshot of the constructionLines for this group
SDK 2.7.0 Protocol 1.5.0
constructionPoints()
Section titled “constructionPoints()”constructionPoints(
filter?):Promise<readonlyConstructionPoint[]>
Query to find the constructionPoints for this group
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
|
|
|
|
Returns
Section titled “Returns”Promise<readonly ConstructionPoint[]>
a promise containing a snapshot of the constructionPoints for this group
SDK 2.7.0 Protocol 1.5.0
curves()
Section titled “curves()”Gets the curves for this group
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
|
|
|
|
optional filter to apply to the list of curves |
Returns
Section titled “Returns”Promise<readonly (ArcCurve | Curve)[]>
SDK 2.23.0 Protocol 1.20.0
dimensionLinears()
Section titled “dimensionLinears()”dimensionLinears(
filter?):Promise<readonlyDimensionLinear[]>
Query to find the dimension linear entities for this group
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
|
|
|
|
optional additional filtering to apply |
Returns
Section titled “Returns”Promise<readonly DimensionLinear[]>
a promise containing a snapshot of the dimension linear entities for this group
SDK 2.23.0 Protocol 1.20.0
dimensionRadials()
Section titled “dimensionRadials()”dimensionRadials(
filter?):Promise<readonlyDimensionRadial[]>
Query to find the dimension radial entities for this group
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
|
|
|
|
optional additional filtering to apply |
Returns
Section titled “Returns”Promise<readonly DimensionRadial[]>
a promise containing a snapshot of the dimension radial entities for this group
SDK 2.23.0 Protocol 1.20.0
edges()
Section titled “edges()”edges(
filter?):Promise<readonlyEdge[]>
Query to find the edges for this group
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
|
|
|
|
Returns
Section titled “Returns”Promise<readonly Edge[]>
a promise containing a snapshot of the edges for this group
faces()
Section titled “faces()”faces(
filter?):Promise<readonlyFace[]>
Query to find the faces for this group
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
|
|
|
|
Returns
Section titled “Returns”Promise<readonly Face[]>
a promise containing a snapshot of the faces for this group
getActiveSectionPlane()
Section titled “getActiveSectionPlane()”getActiveSectionPlane():
Promise<SectionPlane|undefined>
Gets the active section plane for the given entities container.
Returns
Section titled “Returns”Promise<SectionPlane | undefined>
A promise resolving to the SectionPlaneRef or undefined if none is active
SDK 2.16.0 Protocol 1.13.0
groups()
Section titled “groups()”groups(
filter?):Promise<readonlyGroup[]>
Query to find the groups for this group
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
|
|
|
|
Returns
Section titled “Returns”Promise<readonly Group[]>
a promise containing a snapshot of the groups for this group
images()
Section titled “images()”images(
filter?):Promise<readonlyImageEntity[]>
Query to find the images for this group
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
|
|
|
|
optional additional filtering to apply |
Returns
Section titled “Returns”Promise<readonly ImageEntity[]>
a promise containing a snapshot of the images for this group
SDK 2.21.0 Protocol 1.18.0
sectionPlanes()
Section titled “sectionPlanes()”sectionPlanes(
filter?):Promise<readonlySectionPlane[]>
Query to find the sectionPlanes for this group
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
|
|
|
|
Returns
Section titled “Returns”Promise<readonly SectionPlane[]>
a promise containing a snapshot of the sectionPlanes for this group
SDK 2.16.0 Protocol 1.13.0
snaps()
Section titled “snaps()”snaps(
filter?):Promise<readonlySnap[]>
Query to find the snaps for this group
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
|
|
|
|
Returns
Section titled “Returns”Promise<readonly Snap[]>
a promise containing a snapshot of the snaps for this group
SDK 2.20.0 Protocol 1.17.0
texts()
Section titled “texts()”texts(
filter?):Promise<readonlyText[]>
Query to find the texts for this group
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
|
|
|
|
Returns
Section titled “Returns”Promise<readonly Text[]>
a promise containing a snapshot of the texts for this group
SDK 2.22.0 Protocol 1.19.0