Skip to content

TagFolderRef

A lightweight placeholder for a TagFolder that hasn’t been fully loaded yet.

When you create tag folders inside a SketchupOperation, the API returns TagFolderRef objects immediately, before SketchUp has finished processing. You can pass these refs to other operation methods (like creating tags inside the folder), but if you need the full TagFolder instance, you can request it with entityForRef().

Tag folders organize tags (layers) into collapsible groups in the Tags panel — useful when a model has many tags.

Think of a ref as a “claim ticket” — it guarantees a tag folder will exist after the operation commits, but it doesn’t carry the folder’s properties (name, children, etc.) yet. A ref is only valid inside the performOperation callback that created it — do not return it or use it after the operation commits.

let model = await SketchUpApi.getActiveModel();
await model.performOperation(async op => {
// Create a folder to organize MEP tags
const folderRef = op.createTagFolder('MEP');
// Create tags inside the folder
op.createTag('Plumbing', folderRef);
op.createTag('Electrical', folderRef);
op.createTag('HVAC', folderRef);
const folder = await op.entityForRef(folderRef);
console.log(folder.name);
// => "MEP"
}, 'Create MEP tag folder');

readonly sketchupId: Readonly<SketchupId>

the sketchupId of this tag folder reference


readonly type: TagFolder = EntityType.TagFolder

get typeName(): string

Returns a named variant of the type field.

SDK 2.35.0

string