Skip to content

SceneRef

A lightweight placeholder for a Scene that hasn’t been fully loaded yet.

When you create scenes inside a SketchupOperation, the API returns SceneRef objects immediately, before SketchUp has finished processing the scene. You can pass these refs to other operation methods (like setting the camera), but if you need the full Scene instance, you can request it with entityForRef().

A scene is a saved camera position and view state — like a bookmark for a particular viewpoint. Scenes appear as tabs at the top of the SketchUp window.

Think of a ref as a “claim ticket” — it guarantees a scene will exist after the operation commits, but it doesn’t carry the scene’s properties (camera, name, etc.) yet. A ref is only valid inside the performOperation callback that created it — do not return it or use it after the operation commits.

let model = await SketchUpApi.getActiveModel();
await model.performOperation(async op => {
const sceneRef = op.createScene('Front View');
// Use the ref to rename the scene
op.sceneSetName(sceneRef, 'Kitchen');
}, 'Create and rename a scene');

readonly sketchupId: SketchupId


readonly type: Scene = EntityType.Scene

get typeName(): string

Returns a named variant of the type field.

SDK 2.35.0

string