Skip to content

CurveRef

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

When you create curves inside a SketchupOperation, the API returns CurveRef objects immediately, before SketchUp has finished processing the geometry. You can often pass these refs to other operation methods, but if you need the full Curve instance (with its edges or isClosed status), you can request it with entityForRef().

Think of a ref as a “claim ticket” — it guarantees a curve will exist after the operation commits, but it doesn’t carry the curve’s properties 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 => {
// Create a curve from several points
const { curve: curveRef } = op.createCurve(
model, [
[0, 0, 0], [30, 10, 0],
[60, 30, 0], [90, 60, 0],
]
);
// Resolve to the full Curve
const curve = await op.entityForRef(curveRef);
console.log(curve.edges.length, curve.length);
// => 3 110.10
}, 'Create a curve from points');

SDK 2.23.0 Protocol 1.20.0

readonly sketchupId: SketchupId


readonly type: Curve = EntityType.Curve

get typeName(): string

Returns a named variant of the type field.

SDK 2.35.0

string