FaceRef
A lightweight placeholder for a Face that hasn’t been fully loaded yet.
When you create a face inside a SketchupOperation, the API returns
a FaceRef immediately, before SketchUp has finished processing it. You can
pass these refs to other operation methods (like applying a material to the
face), but if you need the full Face instance — with properties like
area, normal, vertices, and edges — you can request it with entityForRef().
Think of a ref as a “claim ticket” — it guarantees a face will exist after
the operation commits, but it doesn’t carry the face’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();let Color = SketchUpApi.Color;
await model.performOperation(async op => { // Create a square face const faceRef = op.createFace(model, [ [0, 0, 0], [100, 0, 0], [100, 100, 0], [0, 100, 0], ]); // Apply a red material using the ref const matRef = op.createMaterial('Red'); op.materialSetColor( matRef, new SketchUpApi.Color(255, 0, 0, 255) ); op.drawingElementSetMaterial(faceRef, matRef);}, 'Create a red square face');- Face
- Operation.createFace
- Operation.createMaterial
- Operation.drawingElementSetMaterial
- Operation.entityForRef
Properties
Section titled “Properties”sketchupId
Section titled “sketchupId”
readonlysketchupId:SketchupId
readonlytype:Face=EntityType.Face
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