Skip to content

Model

The central object for reading and modifying a SketchUp model.

You retrieve a model snapshot with SketchUpApi.getActiveModel(). The snapshot captures the model state at that moment — id, revision, entities, materials, scenes, selection, and more. If the model changes (through your operations or the user’s actions), call refresh() to fetch an updated snapshot with a new revision number.

Every modification you make must occur within performOperation(), which wraps your changes in a named, undo-able operation. Queries and read-only methods work outside of operations.

let model = await SketchUpApi.getActiveModel();
console.log(model.title, model.revision);
// Query entities at the model root
let faces = await model.entities.get({
filterBy: { types: ['Face'] }
});
// Modify the model in a named operation
await model.performOperation(async op => {
op.createEdge(model, [[0,0,0], [100,0,0]]);
}, 'Add an edge');
// Refresh to see the new revision
let updated = await model.refresh();
console.log(updated.revision);

readonly attributes: Attributes

The attribute dictionaries attached to the model.


readonly guid: string

Globally unique identifier for this model.


readonly id: number

Session-specific numeric identifier for this model instance.


readonly name: string

Internal name of the model (typically the component definition name if this model was exported as a .skp and re-opened).


readonly options: ModelOptions

Model-level options (units, geolocation, etc.).


readonly revision: number

Increments each time the model changes. Compare revisions to detect whether a snapshot is stale.


readonly title: string

The display title shown in the window title bar, based on the saved file name. Empty string if the model is unsaved.


readonly tools: Tools

Helpers for activating built-in SketchUp tools.


readonly view: View

The active camera and view properties.

get entities(): CallableEntities

Returns an Entities collection for querying and modifying the drawing elements at the model root. Use entities.get() to retrieve faces, edges, groups, etc., optionally filtered by type.

CallableEntities

findEntities(id): Promise<(Entity | undefined)[]>

Bulk retrieval of fresh entity snapshots by ID. Returns undefined for any entity that no longer exists.

Parameter Type Description

id

readonly SketchupId[]

Array of SketchupIds

Promise<(Entity | undefined)[]>

findEntities<T>(snapshot): Promise<(T | undefined)[]>

Bulk re-fetch of entity snapshots. Returns undefined for any entity that has been deleted since your snapshot was taken.

Type Parameter

T extends Entity

Parameter Type Description

snapshot

readonly T[]

Array of existing entity snapshots

Promise<(T | undefined)[]>

findEntities<Ref>(ref): Promise<(EntityFor<Ref> | undefined)[]>

Bulk retrieval from entity references. Returns undefined for any reference whose entity no longer exists.

Type Parameter

Ref extends EntityRef

Parameter Type Description

ref

readonly Ref[]

Array of entity references

Promise<(EntityFor<Ref> | undefined)[]>

findEntities(searchByItems): Promise<(Entity | undefined)[]>

Bulk retrieval of fresh entity snapshots by ID. Returns undefined for any entity that no longer exists.

Parameter Type

searchByItems

readonly (SketchupId | Entity | EntityRef)[]

Promise<(Entity | undefined)[]>


findEntity(id, options): Promise<Entity>

Retrieves a fresh snapshot of an entity by ID, erroring if not found.

Parameter Type Description

id

SketchupId

The entity’s SketchupId

options

StrictlyFindEntityOptions

Pass { errorIfNotFound: true } to throw on missing

Promise<Entity>

Error if the entity no longer exists

findEntity(id, options?): Promise<Entity | undefined>

Retrieves a fresh snapshot of an entity by ID, or undefined if deleted.

Parameter Type Description

id

SketchupId

The entity’s SketchupId

options?

FindEntityOptions

Optional find settings

Promise<Entity | undefined>

findEntity<T>(snapshot, options): Promise<T>

Re-fetches an entity snapshot, erroring if it has been deleted.

Type Parameter

T extends Entity

Parameter Type Description

snapshot

T

An existing entity snapshot

options

StrictlyFindEntityOptions

Pass { errorIfNotFound: true } to throw on missing

Promise<T>

Error if the entity no longer exists

findEntity<T>(snapshot, options?): Promise<T | undefined>

Re-fetches an entity snapshot, or undefined if it has been deleted.

Type Parameter

T extends Entity

Parameter Type Description

snapshot

T

An existing entity snapshot

options?

FindEntityOptions

Optional find settings

Promise<T | undefined>

findEntity<Ref>(ref, options): Promise<EntityFor<Ref>>

Retrieves a fresh snapshot from an entity reference, erroring if deleted.

Type Parameter

Ref extends EntityRef

Parameter Type Description

ref

Ref

An entity reference

options

StrictlyFindEntityOptions

Pass { errorIfNotFound: true } to throw on missing

Promise<EntityFor<Ref>>

Error if the entity no longer exists

findEntity<Ref>(ref, options?): Promise<EntityFor<Ref> | undefined>

Retrieves a fresh snapshot from an entity reference, or undefined if deleted.

Type Parameter

Ref extends EntityRef

Parameter Type Description

ref

Ref

An entity reference

options?

FindEntityOptions

Optional find settings

Promise<EntityFor<Ref> | undefined>


getActivePath(): Promise<ActivePath>

Queries the active editing context (the chain of groups or component instances the user has double-clicked into). Returns an empty path if editing at the model root.

Promise<ActivePath>

A promise resolving to the active path

SDK 2.17.0 Protocol 1.14.0


getActiveSectionPlanes(options?): Promise<readonly SectionPlane[]>

Queries the section planes that are currently active (cutting through the model). Section planes slice geometry to show interior views.

Parameter Type Description

options?

EntityQuery

Optional filter to apply

Promise<readonly SectionPlane[]>

A promise resolving to the active section planes

SDK 2.29.0 Protocol 1.13.0


getAxes(): Promise<Axes>

Queries the origin and orientation of the model’s global axes. These axes define the red, green, and blue direction vectors.

Promise<Axes>

A promise resolving to the model axes


getBounds(): Promise<BoundingBox>

Queries the axis-aligned bounding box that encloses all geometry in the model, in model coordinates.

Promise<BoundingBox>

A promise resolving to the model’s bounding box

SDK 2.30.0 Protocol 0.7.0


getClassifications(): Promise<ClassificationSchema[]>

Queries the classification schemas loaded in this model (IFC, gbXML, etc.). Used to annotate components with structured metadata.

Promise<ClassificationSchema[]>

A promise resolving to the list of schemas

SDK 2.5.0 Protocol 1.3.0


getCRSLocation(): Promise<CRSLocation | undefined>

Queries the Coordinate Reference System (CRS) location, which provides precise geospatial positioning for the model. Returns undefined if no CRS is set or the platform doesn’t support it.

Promise<CRSLocation | undefined>

A promise resolving to the CRS location, or undefined

SDK 2.28.0 Protocol 1.25.0


getCurrentMaterial(): Promise<Material | undefined>

Queries the material currently selected in SketchUp’s Materials panel. This is the material that will be painted when the user uses the Paint Bucket tool.

Promise<Material | undefined>

A promise resolving to the current material, or undefined if none

SDK 2.30.0


getCurrentScene(): Promise<Scene | undefined>

Queries the currently active scene (the one whose tab is selected). Returns undefined if the model has no scenes.

Promise<Scene | undefined>

A promise resolving to the current scene, or undefined

SDK 2.29.0 Protocol 1.7.0


getCurvesForEdges(edges): Promise<(ArcCurve | Curve)[]>

Retrieves the curves associated with a set of edges. Edges that belong to the same curve share a curve object. Edges not part of any curve are omitted from the result.

Parameter Type Description

edges

readonly (Edge | EdgeRef)[]

Array of edges or edge references

Promise<(ArcCurve | Curve)[]>

Array of curves (Curve or ArcCurve)


getDefinitions(): Promise<readonly ComponentDefinition[]>

Queries all component definitions in the model. Each definition can have multiple instances placed throughout the model.

Promise<readonly ComponentDefinition[]>

A promise resolving to the array of definitions

SDK 2.30.0


getEntitiesBoundsByIds(ids): Promise<BoundingBox[]>

Bulk queries for entity bounding boxes. Returns the boxes in the same order as the IDs you supplied.

Parameter Type Description

ids

readonly SketchupId[]

Array of entity IDs

Promise<BoundingBox[]>

A promise resolving to bounding boxes, in request order

SDK 1.8.0 Protocol 0.7.0


getEntityBoundsById(id): Promise<BoundingBox>

Queries the axis-aligned bounding box for a single entity by ID. For bulk lookups, prefer getEntitiesBoundsByIds().

Parameter Type Description

id

SketchupId

The entity’s SketchupId

Promise<BoundingBox>

A promise resolving to the entity’s bounding box

SDK 1.8.0 Protocol 0.7.0


getFacesAreas(faces, transformLike?): Promise<[Face | FaceRef, number][]>

Bulk calculates face areas, accounting for openings cut by glued components (like windows or doors). More accurate than Face.area when components cut openings.

Parameter Type Description

faces

(Face | FaceRef)[]

Array of faces or face references

transformLike?

TransformationLike

Optional transformation to apply

Promise<[Face | FaceRef, number][]>

Array of [face, area in square inches] pairs

SDK 2.25.0 Protocol 1.22.0


getFaceUVs(requests): Promise<FaceBulkResponse>

Bulk calculates UV texture coordinates for multiple faces and points. Much faster than calling Face.getUVs() repeatedly.

Parameter Type Description

requests

FaceBulkRequest

Array of [face, UV request] pairs

Promise<FaceBulkResponse>

Array of [face, UV response] pairs

SDK 2.25.0 Protocol 1.22.0


getMaterials(): Promise<Materials>

Queries all materials defined in the model. The returned Materials collection provides fast lookups by name or ID and lets you iterate over all materials.

Promise<Materials>

A promise resolving to the materials collection

SDK 2.30.0


getNumberOfFaces(): Promise<number>

Counts the total number of faces in the model, including faces inside component instances (expanded count). This matches the count shown in SketchUp’s Entity Info.

Promise<number>

A promise resolving to the total face count

SDK 2.30.0


getRenderingOptions(): Promise<RenderingOptions>

Queries the rendering options (edge display, materials, transparency, X-ray mode, etc.) that control how SketchUp displays the model.

Promise<RenderingOptions>

A promise resolving to the rendering options

SDK 2.24.0 Protocol 1.21.0


getScenes(options?): Promise<Scene[]>

Queries all scenes (saved camera positions and settings) in the model. Scenes appear as tabs in SketchUp and can be animated or exported.

Parameter Type Description

options?

EntityQuery

Optional filter to apply to the list

Promise<Scene[]>

A promise resolving to the array of scenes

SDK 2.29.0 Protocol 1.7.0


getSelectedStyle(): Promise<SelectedStyle>

Queries the currently active style and its info (name, whether it’s been modified, etc.). This is the style applied to the model.

Promise<SelectedStyle>

A promise resolving to the selected style

SDK 2.26.0 Protocol 1.23.0


getSelection(options?): Promise<Selection>

Queries the entities currently selected in SketchUp. You can optionally filter the selection server-side (e.g., only faces) to reduce data transfer.

Parameter Type Description

options?

EntityQuery<EntityFilter> | SketchupEntityFilter

Optional filter to apply server-side

Promise<Selection>

A promise resolving to the selection

SDK 2.14.0 Protocol 1.11.0


getSelectionMetadata(options?): Promise<SelectionMetadata>

Queries selection metadata (count, flags) without fetching the actual entity snapshots. Much faster than getSelection() when you only need to know what’s selected, not the full entities.

Parameter Type Description

options?

EntityQuery<EntityFilter> | SketchupEntityFilter

Optional filter to apply server-side

Promise<SelectionMetadata>

A promise resolving to the selection metadata

SDK 2.14.0 Protocol 1.11.0


getShadowInfo(): Promise<ShadowInfo>

Queries the model’s shadow settings (time, date, location, shadow display state). Used to control how SketchUp renders shadows and sunlight.

Promise<ShadowInfo>

A promise resolving to the shadow info


getSkp(options?): Promise<string>

Exports the model as a .skp file and returns it as a base64-encoded data URL. You can write this to disk, send it over a network, or trigger a browser download.

Parameter Type Description

options?

{ force: boolean; }

Pass { force: true } to save unsaved models with a temporary name

options.force?

boolean

‐

Promise<string>

A data URL: data:application/vnd.sketchup.skp;base64,...

SDK 2.30.3 Protocol 1.8.0


getStyles(options?): Promise<Style[]>

Queries all styles available in the model. Styles control edge, face, and background rendering settings.

Parameter Type Description

options?

EntityQuery<EntityFilter> | SketchupEntityFilter

Optional filter to apply

Promise<Style[]>

A promise resolving to the array of styles

SDK 2.26.0 Protocol 1.23.0


getTagManager(): Promise<TagManager>

Queries the tag manager, which provides access to all tags (formerly called layers) and the active tag. Tags control visibility and can be assigned to entities.

Promise<TagManager>

A promise resolving to the tag manager


invertSelection(): Promise<SelectionMetadata>

Inverts the selection within the current editing context: previously selected entities become unselected and vice versa. This only affects entities in the current active path. Not an undo-able operation.

Promise<SelectionMetadata>

Metadata for the selection after inversion

SDK 2.14.0 Protocol 1.11.0


observeActivePath(callback): ObserverHandle

Subscribes to changes in the active editing context. Your callback fires immediately with the current path, then again whenever the user double-clicks into or out of a group or component.

Parameter Type Description

callback

(activePath) => void

Called with the new active path

ObserverHandle

An observer handle; call .close() to unsubscribe

SDK 2.30.0 Protocol 1.14.0


observeOptionsChanges(callback): ObserverHandle

Subscribes to changes in the model’s options (units, location, etc.). Your callback fires whenever the user changes a setting.

Parameter Type Description

callback

(options) => void

Called with the updated options

ObserverHandle

An observer handle; call .close() to unsubscribe

SDK 2.30.0


observeRenderingOptions(callback): ObserverHandle

Subscribes to changes in the rendering options. Your callback fires whenever the user toggles edges, materials, or other display settings.

Parameter Type Description

callback

(data) => void

Called with the change event

ObserverHandle

An observer handle; call .close() to unsubscribe

SDK 2.30.0 Protocol 1.21.0


observeSelectionMetadata(callback, options?): ObserverHandle

Subscribes to changes in the selection. For performance, only metadata (count, flags) is sent. If you need the actual entities, call getSelection() on the metadata object.

Parameter Type Description

callback

(options) => void

Called with updated selection metadata

options?

EntityQuery<EntityFilter> | SketchupEntityFilter

Optional server-side filter

ObserverHandle

An observer handle; call .close() to unsubscribe

SDK 2.30.0 Protocol 1.11.0


performOperation<T>(instructions, name, options?): Promise<T>

Performs a named, undo-able operation on the model. All modifications to the model (adding entities, editing geometry, changing materials) must occur within an operation. If the instructions function throws, the operation is automatically aborted and the model is rolled back.

Note that if the operation makes no changes, the model’s revision number will not increment.

Type Parameter

T

Parameter Type Description

instructions

(operation) => T | Promise<T>

Sync or async function that performs the changes

name

string

Name shown in SketchUp’s undo stack

options?

OperationOptions

Optional operation settings

Promise<T>

A promise resolving to the value your instructions return


redo(): Promise<void>

Re-does the most recently undone operation. Equivalent to the user pressing Cmd+Shift+Z (Mac) or Ctrl+Y (Windows).

Promise<void>

A promise that resolves when the redo completes

SDK 1.7.0 Protocol 0.6.0


refresh(): Promise<Model>

Re-fetches a fresh snapshot of this model. The new snapshot will have an updated revision number if the model has changed since you last retrieved it. Use this after operations or when you suspect the user has modified the model.

Promise<Model>

A promise resolving to a new model snapshot

let model = await SketchUpApi.getActiveModel();
await model.performOperation(
() => {},
'Modify the model'
);
let updated = await model.refresh();
console.log(updated.revision);

setCurrentScene(scene): Promise<void>

Activates the specified scene, switching the camera and settings to match that scene’s saved state. This is a view operation and does not require an operation wrapper.

Parameter Type Description

scene

Scene | SceneRef

The scene to activate

Promise<void>

SDK 2.29.0 Protocol 1.7.0


startOperation(name, options?): Promise<Operation>

Starts an operation manually, requiring you to call commit() or abort() explicitly. Prefer performOperation() instead — it handles commit/abort automatically and is safer.

Note that only one operation can be open at a time.

Parameter Type Description

name

string

Name shown in SketchUp’s undo stack

options?

OperationOptions

Optional operation settings

Promise<Operation>

A promise resolving to the operation handle


toString(): string

string


undo(): Promise<void>

Undoes the most recent operation in the model’s undo stack. Equivalent to the user pressing Cmd+Z (Mac) or Ctrl+Z (Windows).

Promise<void>

A promise that resolves when the undo completes

SDK 1.7.0 Protocol 0.6.0


updateRenderingOptions(update): Promise<void>

Updates one or more rendering options. If any key or value is invalid, this throws an error — but other valid updates in the same call will have already been applied.

Parameter Type Description

update

RenderingOptionsUpdate

Key-value pairs of rendering options to update

Promise<void>

SDK 2.24.0 Protocol 1.21.0

Error if any key or value is invalid


updateSelection(drawingElements, updateType): Promise<SelectionMetadata>

Changes which entities are selected in SketchUp. Pass 'add' to extend the current selection, 'remove' to deselect specific entities, 'replace' to clear everything and select only the given entities, or 'toggle' to flip each entity’s selected state. This is not an undo-able operation — it directly modifies the UI selection.

Parameter Type

drawingElements

DrawingElement | DrawingElementRef | readonly DrawingElement[] | readonly DrawingElementRef[] | readonly DrawingElement | DrawingElementRef[]

updateType

"toggle" | "add" | "replace" | "remove"

Promise<SelectionMetadata>

Metadata for the selection after the update

SDK 2.14.0 Protocol 1.11.0

get bounds(): Promise<BoundingBox>

SDK 1.8.0 Protocol 0.7.0

Promise<BoundingBox>


get classifications(): Promise<readonly ClassificationSchema[]>

SDK 2.5.0 Protocol 1.3.0

Promise<readonly ClassificationSchema[]>


activeSectionPlanes(filter?): Promise<readonly SectionPlane[]>

Query to find only the active section planes (protocol)

Parameter Type Default value Description

filter

SketchupEntityFilter | undefined

undefined

when provided, filters the list of active section planes

Promise<readonly SectionPlane[]>

a promise containing a snapshot of the active section planes

SDK 2.16.0 Protocol 1.13.0


componentInstances(filter?): Promise<readonly ComponentInstance[]>

Typesafe query to get all the component instances at the root of the model

Parameter Type Default value Description

filter

SketchupEntityFilter | undefined

undefined

optional additional filtering to apply

Promise<readonly ComponentInstance[]>

a promise containing the array of component instances

Model.entities


components(): Promise<readonly ComponentDefinition[]>

Query to get all the component (definitions) in the model

Promise<readonly ComponentDefinition[]>

a promise containing the components


constructionLines(filter?): Promise<readonly ConstructionLine[]>

Query to find the constructionLines

Parameter Type Default value

filter

SketchupEntityFilter | undefined

undefined

Promise<readonly ConstructionLine[]>

a promise containing a snapshot of the constructionLines

SDK 2.7.0 Protocol 1.5.0


constructionPoints(filter?): Promise<readonly ConstructionPoint[]>

Query to find the constructionPoints

Parameter Type Default value

filter

SketchupEntityFilter | undefined

undefined

Promise<readonly ConstructionPoint[]>

a promise containing a snapshot of the constructionPoints

SDK 2.7.0 Protocol 1.5.0


currentMaterial(): Promise<Material | undefined>

Promise<Material | undefined>


curves(filter?): Promise<readonly (ArcCurve | Curve)[]>

Gets the curves for root of this model

Parameter Type Default value Description

filter

SketchupEntityFilter | undefined

undefined

optional filter to apply to the list of curves

Promise<readonly (ArcCurve | Curve)[]>

SDK 2.23.0 Protocol 1.20.0


dimensionLinears(filter?): Promise<readonly DimensionLinear[]>

Query to find the dimension linear entities for this group

Parameter Type Default value Description

filter

SketchupEntityFilter | undefined

undefined

optional additional filtering to apply

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(filter?): Promise<readonly DimensionRadial[]>

Query to find the dimension radial entities for this group

Parameter Type Default value Description

filter

SketchupEntityFilter | undefined

undefined

optional additional filtering to apply

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(filter?): Promise<readonly Edge[]>

Typesafe query to get all the edges at the root of the model

Parameter Type Default value Description

filter

SketchupEntityFilter | undefined

undefined

optional additional filtering to apply

Promise<readonly Edge[]>

a promise containing the array of edges

Model.entities


export(options?): Promise<string>

Parameter Type

options?

{ force: boolean; }

options.force?

boolean

Promise<string>

SDK 2.11.0 Protocol 1.8.0


faces(filter?): Promise<readonly Face[]>

Typesafe query to get all the faces at the root of the model

Parameter Type Default value Description

filter

SketchupEntityFilter | undefined

undefined

optional additional filtering to apply

Promise<readonly Face[]>

a promise containing the array of faces

Model.entities


findCurvesForEdges(edges): Promise<(ArcCurve | Curve)[]>

Parameter Type

edges

readonly (Edge | EdgeRef)[]

Promise<(ArcCurve | Curve)[]>


findEntitiesById(ids): Promise<(Entity | undefined)[]>

Query to find an entities by an array of ids

Parameter Type Description

ids

readonly SketchupId[]

the array of entity ids

Promise<(Entity | undefined)[]>

a promise with an array or entities in the order requested. If an entity is not found the array entry will be undefined.


findEntityById(id): Promise<Entity | undefined>

Query to find an entity by id

Parameter Type Description

id

SketchupId

the entity id

Promise<Entity | undefined>

a promise with the entity, or undefined if no matching entity was found


findEntityWithTypeById<Type>(id, expectedType): Promise<EntityFromSketchupEntityEnum<Type> | undefined>

Utility to find an entity and validate the type. Usually called internally.

Type Parameter

Type extends EntityType

Parameter Type Description

id

SketchupId

the entity id

expectedType

Type

the expected type of the entity

Promise<EntityFromSketchupEntityEnum<Type> | undefined>

a promise with the entity or undefined

Error if the type of the entity from SketchUp does not match the expected type


getActiveSectionPlane(): Promise<SectionPlane | undefined>

Gets the active section plane for the given entities container.

Promise<SectionPlane | undefined>

A promise resolving to the SectionPlaneRef or undefined if none is active

SDK 2.16.0 Protocol 1.13.0


groups(filter?): Promise<readonly Group[]>

Typesafe query to get all the groups at the root of the model

Parameter Type Default value Description

filter

SketchupEntityFilter | undefined

undefined

optional additional filtering to apply

Promise<readonly Group[]>

a promise containing the array of groups

Model.entities


images(filter?): Promise<readonly ImageEntity[]>

Query to find the images at the root of this model

Parameter Type Default value Description

filter

SketchupEntityFilter | undefined

undefined

optional additional filtering to apply

Promise<readonly ImageEntity[]>

a promise containing a snapshot of the images for this model

SDK 2.21.0 Protocol 1.18.0


materials(): Promise<Materials>

Promise<Materials>


numberOfFaces(): Promise<number>

Promise<number>


sectionPlanes(filter?): Promise<readonly SectionPlane[]>

Query to find the sectionPlanes

Parameter Type Default value

filter

SketchupEntityFilter | undefined

undefined

Promise<readonly SectionPlane[]>

a promise containing a snapshot of the sectionPlanes

SDK 2.16.0 Protocol 1.13.0


snaps(filter?): Promise<readonly Snap[]>

Query to find the snaps

Parameter Type Default value

filter

SketchupEntityFilter | undefined

undefined

Promise<readonly Snap[]>

a promise containing a snapshot of the snaps

SDK 2.20.0 Protocol 1.17.0


streamActivePath(callback): ObserverHandle

Streams changes to the active path on the current model

Parameter Type Description

callback

(activePath) => void

callback that gets invoked whenever the active path changes.

NOTE: This will be invoked immediately

ObserverHandle

a closable stream handle

SDK 2.17.0 Protocol 1.14.0


streamOptionsChanges(callback): ObserverHandle

Stream the changes to the model options

Parameter Type Description

callback

(options) => void

invoked whenever there is a change to the options in the model

ObserverHandle

a stream handle, used to cancel the stream.


streamRenderingOptions(callback): ObserverHandle

Streams changes to the rendering options associated with this model

Parameter Type

callback

(data) => void

ObserverHandle

SDK 2.24.0 Protocol 1.21.0


streamSelectionMetadata(callback, options?): ObserverHandle

Streams changes to the selection metadata in SketchUp.

NOTE this does not give you direct access to the selected entities for performance reasons. If you need to pull all the selected entities based on this metadata change, call getSelection on the metadata object

Parameter Type Description

callback

(options) => void

callback invoked when there is a change to the selection.

options?

EntityQuery<EntityFilter> | SketchupEntityFilter

when supplied this provides server side filtering to the values returned to the client

ObserverHandle

The stream handle, used to cancel the stream

SDK 2.14.0 Protocol 1.11.0


texts(filter?): Promise<readonly Text[]>

Query to find the texts

Parameter Type Default value

filter

SketchupEntityFilter | undefined

undefined

Promise<readonly Text[]>

a promise containing a snapshot of the texts

SDK 2.22.0 Protocol 1.19.0