DimensionLinearRef
A lightweight placeholder for a DimensionLinear that hasn’t been fully loaded yet.
When you create linear dimensions inside a SketchupOperation,
the API returns DimensionLinearRef objects immediately, before
SketchUp has finished processing the annotation. You can often
pass these refs to other operation methods, but if you need the
full DimensionLinear instance, you can request it with
entityForRef().
A linear dimension is an annotation that shows the measured
distance between two points — like the dimension lines you see
in architectural drawings. Think of a ref as a “claim ticket” —
it guarantees a dimension will exist after the operation commits,
but it doesn’t carry the dimension’s properties (text, position,
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.
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();
await model.performOperation(async op => { // Dimension between two points const dimRef = op.createDimensionLinear( model, [0, 0, 0], // start point [100, 0, 0], // end point [0, 0, 10] // offset (text above) ); // Use the ref to reposition the text op.dimensionLinearSetOffset( dimRef, [0, 0, 25] );}, 'Create a linear dimension');- DimensionLinear
- Operation.createDimensionLinear
- Operation.dimensionLinearSetOffset
- Operation.entityForRef
SDK 2.23.0 Protocol 1.20.0
Properties
Section titled “Properties”sketchupId
Section titled “sketchupId”
readonlysketchupId:SketchupId
readonlytype:DimensionLinear=EntityType.DimensionLinear
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