Skip to content

ConstructionLineRef

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

When you create construction lines inside a SketchupOperation, the API returns ConstructionLineRef 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 ConstructionLine instance, you can request it with entityForRef().

Think of a ref as a “claim ticket” — it guarantees a construction line will exist after the operation commits, but it doesn’t carry the line’s properties (start, end, stipple, 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();
let { Point3d } = SketchUpApi;
await model.performOperation(async op => {
// Create a dashed guide at y = 20
const lineRef = op.createConstructionLine(
model,
new Point3d(0, 20, 0),
new Point3d(100, 20, 0),
'-'
);
// Use the ref to change its stipple
op.constructionLineSetStipple(lineRef, '.');
}, 'Create a guide line');

SDK 2.7.0 Protocol 1.5.0

readonly sketchupId: SketchupId


readonly type: ConstructionLine = EntityType.ConstructionLine

get typeName(): string

Returns a named variant of the type field.

SDK 2.35.0

string