Skip to content

ConstructionPoint

A guide point in 3D space used for alignment and reference.

Construction points are helpers that don’t affect your model’s geometry — they’re visual markers you can snap to when drawing. They’re useful for marking centers, midpoints, or any location you’ll reference repeatedly.

Unlike vertices (which define edges and faces), construction points exist independently and can be placed anywhere in 3D space.

let model = await SketchUpApi.getActiveModel();
// Create a construction point at a specific location.
await model.performOperation(op => {
op.createConstructionPoint(model, [50, 100, 0]);
}, 'Add guide point');
// Query it back to verify its position.
let points = await model.entities.get({
filterBy: { types: ['ConstructionPoint'] }
});
let pt = points[0];
console.log(pt.position.x, pt.position.y);
// => 50 100

SDK 2.7.0 Protocol 1.5.0

  • BaseDrawingElement

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 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 construction point.


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 position: Point3d

The 3D coordinates of this construction point in model space.


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 type: ConstructionPoint = EntityType.ConstructionPoint

get sketchupId(): SketchupId

JS API identifier for this construction point. 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<ConstructionPoint>

Re-fetches this construction point from SketchUp to get its current state. Because ConstructionPoint is a snapshot, it can become stale if the model changes. Call refresh() to get an up-to-date copy.

Promise<ConstructionPoint>

A new ConstructionPoint reflecting the current model state. Throws if the point has been deleted.

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

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