UnknownEntityRef
A fallback ref for entity types the SDK doesn’t recognize.
When SketchUp returns an entity reference with a type that
this version of the SDK hasn’t been updated to handle,
it wraps the reference in an UnknownEntityRef rather than
crashing. The type property is undefined, and the ref
still carries a valid sketchupId — you just can’t resolve
it to a typed class.
You’ll typically encounter this when a newer version of
SketchUp introduces entity types that your SDK version
predates. Checking for undefined type lets you handle
these gracefully.
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();let entities = await model.entities.get();
for (const entity of entities) { if (entity.type === undefined) { console.log('Unknown entity:', entity.id); } else { console.log(entity.type, entity.id); }}Properties
Section titled “Properties”sketchupId
Section titled “sketchupId”
readonlysketchupId:SketchupId
readonlytype:undefined=undefined
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