Skip to content

DimensionRadial

An annotation that measures the radius or diameter of a circle or arc.

Radial dimensions are used to label curved geometry with its radius measurement. They display the letter “R” followed by the radius value and draw a leader line from the text to the curve. You typically create them with Operation.createDimensionRadial inside an operation.

Because DimensionRadial is a snapshot, it reflects the dimension’s state at the moment you fetched it. If the user moves or modifies the dimension, call refresh to get an updated copy.

let model = await SketchUpApi.getActiveModel();
// Create a circle and add a radial dimension.
await model.performOperation(op => {
const circle = op.createCircle(
model,
[0, 0, 0], // center
[0, 0, 1], // normal
50, 24 // radius, segments
);
op.createDimensionRadial(
model,
circle.curve,
[75, 0, 0] // leader break point
);
}, 'Annotate circle with radial dimension');
// Query back all radial dimensions to see the text.
let dims = await model.entities.get({
filterBy: { types: ['DimensionRadial'] }
});
console.log(dims[0].text);
// => "R50.0"

SDK 2.23.0 Protocol 1.20.0

  • BaseDrawingElement

readonly arcCurve: ArcCurveRef | undefined

A reference to the arc curve being measured. Call model.findEntity(dimension.arcCurve) to fetch the full ArcCurve object. May be undefined if the curve has been deleted.


readonly arrowType: DimensionArrowType

The style of arrow displayed at the end of the leader line. Controls whether the dimension shows a closed arrow, open arrow, dot, slash, or no arrow at all.


readonly attributes: Attributes

The attribute dictionaries attached to this element. Attributes store custom key-value metadata that extensions can read and write.

BaseDrawingElement.attributes


readonly castsShadows: boolean

Whether this element casts shadows onto other geometry.

BaseDrawingElement.castsShadows


readonly hasAlignedText: boolean

Whether the dimension text is aligned parallel to the leader line. When true, the text rotates to match the leader angle; when false, it stays horizontal (screen-aligned).


readonly hidden: boolean

Whether this element is hidden. Hidden elements don’t appear in the viewport unless the user enables “View > Hidden Geometry.”

BaseDrawingElement.hidden


readonly id: number

The persistent ID that uniquely identifies this dimension.


readonly leaderPoints: Point3d[]

The points that define the dimension’s leader line, starting with the break point (where the leader meets the text) and ending at the curve. Use leaderBreakPoint to access the first point directly.


readonly materialRef: MaterialRef | undefined

A reference to the material applied to this element, if any. Call getMaterial() to fetch the full Material object with color and texture data.

BaseDrawingElement.materialRef


readonly plane: Plane

The plane in which this dimension lies. The plane’s origin, x-axis, and y-axis define the 2D coordinate space for the dimension’s leader and text.


readonly receivesShadows: boolean

Whether this element receives shadows cast by other geometry.

BaseDrawingElement.receivesShadows


readonly tagRef: TagRef | undefined

A reference to the tag (formerly “layer”) assigned to this element. Call getTag() to fetch the full Tag object.

BaseDrawingElement.tagRef


readonly text: string

The displayed measurement text, including the “R” prefix and radius value. For example, a 50-unit circle shows as "R50.0". This reflects the model’s current unit settings and precision.


readonly type: DimensionRadial = EntityType.DimensionRadial

get leaderBreakPoint(): Point3d

The point where the leader line breaks away from the text box. This is the first point in leaderPoints — a convenience accessor for the most commonly referenced point on the leader.

Point3d


get sketchupId(): SketchupId

JS API identifier for this dimension. Pass it to API methods that accept a sketchupId.

SketchupId

BaseDrawingElement.sketchupId


get typeName(): string

Returns a named variant of the type field.

SDK 2.35.0

string

getBounds(): Promise<BoundingBox>

Fetches the axis-aligned bounding box for this element from SketchUp.

Promise<BoundingBox>

let model = await SketchUpApi.getActiveModel();
let all = await model.entities.get();
let element = all[0];
let box = await element.getBounds();
console.log(box.min.x, box.min.y, box.min.z);
console.log(box.max.x, box.max.y, box.max.z);

SDK 2.30.0

BaseDrawingElement.getBounds


getMaterial(): Promise<Material | undefined>

Fetches the material applied to this element. Returns undefined if the element uses the default material.

Promise<Material | undefined>

let model = await SketchUpApi.getActiveModel();
let all = await model.entities.get();
let element = all[0];
let mat = await element.getMaterial();
if (mat) {
console.log(mat.name, mat.color.toHex());
}

SDK 2.30.0

BaseDrawingElement.getMaterial


getTag(): Promise<Tag | undefined>

Fetches the tag assigned to this element. Most elements have a tag — even those on the default “Untagged” tag. Returns undefined only if the tag reference is missing.

Promise<Tag | undefined>

let model = await SketchUpApi.getActiveModel();
let all = await model.entities.get();
let element = all[0];
let tag = await element.getTag();
if (tag) {
console.log(tag.name);
}

SDK 2.30.0

BaseDrawingElement.getTag


refresh(): Promise<DimensionRadial>

Re-fetches this dimension from SketchUp to get its current state. Because DimensionRadial is a snapshot, it can become stale if the user moves the dimension text or if the measured curve changes. Call refresh() to get an up-to-date copy.

Promise<DimensionRadial>

A new DimensionRadial reflecting the current model state. Throws if the dimension has been deleted.

let model = await SketchUpApi.getActiveModel();
let dims = await model.entities.get({
filterBy: { types: ['DimensionRadial'] },
});
// Later, after the user makes changes...
let fresh = await dims[0].refresh();
console.log(fresh.text);

toString(): string

Returns a string representation of an object.

string

readonly materialId: number | undefined

BaseDrawingElement.materialId


readonly tagId: number | undefined

BaseDrawingElement.tagId


get bounds(): Promise<BoundingBox>

Promise<BoundingBox>

BaseDrawingElement.bounds


get tag(): Promise<Readonly<Tag> | undefined>

Promise<Readonly<Tag> | undefined>

BaseDrawingElement.tag