SectionPlane
A clipping plane that cuts through the model to reveal interior geometry.
Section planes are used to create cutaway views of buildings, mechanical parts, or any 3D model where you need to see what’s inside. The plane is defined by four coefficients [a, b, c, d] that form the equation ax + by + cz + d = 0. Everything on one side of the plane is hidden, revealing the cross-section.
Only one section plane can be active at a time. When a section plane is active, SketchUp hides geometry on the negative side of the plane and optionally displays the cut surface. You can control visibility of section cuts and planes through Model.updateRenderingOptions.
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();
// Make section cuts visible in the viewportawait model.updateRenderingOptions({ DisplaySectionCuts: true, DisplaySectionPlanes: true,});
// Create a horizontal section plane at height 50await model.performOperation(op => { // Plane equation [0, 0, 1, -50] cuts at z = 50 const planeRef = op.createSectionPlane( model, [0, 0, 1, -50] ); op.sectionPlaneActivate(planeRef);}, 'Create section plane');
// Query the section plane backlet planes = await model.entities.get({ filterBy: { types: ['SectionPlane'] }});let sectionPlane = planes[0];
console.log(sectionPlane.active);// => trueconsole.log(sectionPlane.plane);// => { a: 0, b: 0, c: 1, d: -50 }SDK 2.16.0 Protocol 1.13.0
Extends
Section titled “Extends”BaseDrawingElement
Properties
Section titled “Properties”active
Section titled “active”
readonlyactive:boolean
Whether this section plane is currently active and performing the cut. Only one section plane can be active at a time. Use Operation.sectionPlaneActivate to activate a plane.
attributes
Section titled “attributes”
readonlyattributes:Attributes
The attribute dictionaries attached to this element. Attributes store custom key-value metadata that extensions can read and write.
Inherited from
Section titled “Inherited from”BaseDrawingElement.attributes
castsShadows
Section titled “castsShadows”
readonlycastsShadows:boolean
Whether this element casts shadows onto other geometry.
Inherited from
Section titled “Inherited from”BaseDrawingElement.castsShadows
hidden
Section titled “hidden”
readonlyhidden:boolean
Whether this element is hidden. Hidden elements don’t appear in the viewport unless the user enables “View > Hidden Geometry.”
Inherited from
Section titled “Inherited from”BaseDrawingElement.hidden
readonlyid:number
The persistent ID that uniquely identifies this section plane.
materialRef
Section titled “materialRef”
readonlymaterialRef: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.
Inherited from
Section titled “Inherited from”BaseDrawingElement.materialRef
readonlyname:string
The display name shown in the Outliner and assigned by SketchUp, like “Section Plane 1” or a custom name set by the user.
readonlyplane:Plane
The plane equation coefficients that define where this section plane cuts. The plane follows ax + by + cz + d = 0, where [a, b, c] is the normal vector and d is the distance from the origin.
receivesShadows
Section titled “receivesShadows”
readonlyreceivesShadows:boolean
Whether this element receives shadows cast by other geometry.
Inherited from
Section titled “Inherited from”BaseDrawingElement.receivesShadows
symbol
Section titled “symbol”
readonlysymbol:string
A single-character label displayed on the section plane glyph in the viewport, like “A”, “B”, or “C”. SketchUp assigns these automatically.
tagRef
Section titled “tagRef”
readonlytagRef:TagRef|undefined
A reference to the tag (formerly “layer”) assigned to this element. Call
getTag() to fetch the full Tag object.
Inherited from
Section titled “Inherited from”BaseDrawingElement.tagRef
readonlytype:SectionPlane=EntityType.SectionPlane
Accessors
Section titled “Accessors”sketchupId
Section titled “sketchupId”Get Signature
Section titled “Get Signature”get sketchupId():
SketchupId
JS API identifier for this section plane. Pass it to API methods that accept a sketchupId.
Returns
Section titled “Returns”Overrides
Section titled “Overrides”BaseDrawingElement.sketchupId
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”getBounds()
Section titled “getBounds()”getBounds():
Promise<BoundingBox>
Fetches the axis-aligned bounding box for this element from SketchUp.
Returns
Section titled “Returns”Promise<BoundingBox>
Example
Section titled “Example”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
Inherited from
Section titled “Inherited from”BaseDrawingElement.getBounds
getMaterial()
Section titled “getMaterial()”getMaterial():
Promise<Material|undefined>
Fetches the material applied to this element. Returns undefined if the
element uses the default material.
Returns
Section titled “Returns”Promise<Material | undefined>
Example
Section titled “Example”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
Inherited from
Section titled “Inherited from”BaseDrawingElement.getMaterial
getTag()
Section titled “getTag()”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.
Returns
Section titled “Returns”Promise<Tag | undefined>
Example
Section titled “Example”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
Inherited from
Section titled “Inherited from”BaseDrawingElement.getTag
refresh()
Section titled “refresh()”refresh():
Promise<SectionPlane>
Re-fetches this section plane from SketchUp to get its current state. Because
SectionPlane is a snapshot, it can become stale if the model changes (for
example, if another section plane is activated). Call refresh() to get an
up-to-date copy.
Returns
Section titled “Returns”Promise<SectionPlane>
A new SectionPlane reflecting the current model state. Throws if the section plane has been deleted.
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();let planes = await model.entities.get({ filterBy: { types: ['SectionPlane'] },});// Later, after the user makes changes...let fresh = await planes[0].refresh();console.log(fresh.active, fresh.plane);toString()
Section titled “toString()”toString():
string
Returns a string representation of an object.
Returns
Section titled “Returns”string
Deprecated
Section titled “Deprecated”materialId
Section titled “materialId”
readonlymaterialId:number|undefined
Inherited from
Section titled “Inherited from”BaseDrawingElement.materialId
readonlytagId:number|undefined
Inherited from
Section titled “Inherited from”BaseDrawingElement.tagId
bounds
Section titled “bounds”Get Signature
Section titled “Get Signature”get bounds():
Promise<BoundingBox>
Returns
Section titled “Returns”Promise<BoundingBox>
Inherited from
Section titled “Inherited from”BaseDrawingElement.bounds
Get Signature
Section titled “Get Signature”get tag():
Promise<Readonly<Tag> |undefined>
Returns
Section titled “Returns”Promise<Readonly<Tag> | undefined>
Inherited from
Section titled “Inherited from”BaseDrawingElement.tag