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.
Example
Section titled “Example”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
Properties
Section titled “Properties”sketchupId
Section titled “sketchupId”
readonlysketchupId:SketchupId
readonlytype:Curve=EntityType.Curve
Accessors
Section titled “Accessors”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”toString()
Section titled “toString()”toString():
string
Returns
Section titled “Returns”string