Skip to content
Get on GitHub Autodesk App Store - coming soon

Navisworks: SelectionSets

17 nodes. Types ending in [] are lists. An input with a default is optional.

SelectionSet.ByName

Finds a saved selection or search set by its display name (searches folders too). It only looks: nothing is created or changed. Looks again on every run.

Inputs

Input Type Default What it does
name required string — The set's display name.
document Document null The document (defaults to the active document).

Outputs

Output Type What it gives
selectionSet SelectionSet The stored selection set.

Tags: selection set byname find

SelectionSet.Create

Creates a saved selection set from the given items, filed in the folder you name (a folder from SelectionSets.CreateFolder, a folder name, or a path such as "Walls/Level 1"; a folder that does not exist yet is created; empty means the top level). An existing set with the same name in the same place is replaced, so re-running a graph updates the set instead of piling up copies. A list of names with a list of item lists makes one set per pair. Inside a node group every instance uses the same name unless you wire it in, so two instances would replace each other's set.

Inputs

Input Type Default What it does
name required string — Display name for the new set.
items any number of wires required ModelItem[] — The model items to store.
folder any null Where to file the set: a folder (e.g. from SelectionSets.CreateFolder), a folder name, or a path such as "Walls/Level 1". A folder that does not exist yet is created. Leave it empty for the top level.
document Document null The document (defaults to the active document).

Outputs

Output Type What it gives
selectionSet SelectionSet The stored selection set.

Tags: selection set create save new folder

SelectionSet.CreateFromSearch

Creates a live SEARCH set from a property rule, with the same modes as Search.ByProperty (equals, contains, wildcard, >, >=, <, <= or exists; a list in value means any of its entries) — it re-evaluates as the model changes, so "Diameter > 100" or "Name contains DEMO" stays up to date. It is filed in the folder you name (empty means the top level), and an existing set with the same name in the same place is replaced. Inside a node group every instance uses the same name unless you wire it in, so two instances would replace each other's set.

Inputs

Input Type Default What it does
name required string — Display name for the new search set.
categoryName required string — Category display name (e.g. "Element"). Internal names do not match.
propertyName required string — Property display name (e.g. "Level"). Internal names do not match. With mode "exists", leave it empty to ask only for the category (tab).
value any null What to look for, as in Search.ByProperty: any value for "equals", text for "contains" and "wildcard", a number for the four comparisons, not used by "exists". A list means "any of these".
mode string "equals" How the property is matched: equals, contains, wildcard, >, >=, <, <= or exists.
folder any null Where to file the set: a folder, a folder name, or a path such as "Walls/Level 1". A folder that does not exist yet is created. Leave it empty for the top level.
document Document null The document (defaults to the active document).

Outputs

Output Type What it gives
selectionSet SelectionSet The stored search set (it re-evaluates as the model changes).

Tags: selection search set create live rule folder contains wildcard compare

SelectionSet.Delete

Deletes a saved selection or search set by name (searches folders too). Returns false when absent — safe for clean re-runs.

Inputs

Input Type Default What it does
name required string — The set's display name (folders are searched too).
document Document null The document (defaults to the active document).

Outputs

Output Type What it gives
deleted boolean True when a set was deleted; false when no set has that name.

Tags: selection set delete remove clean

SelectionSet.Duplicate

Duplicates a saved selection or search set in its folder (a search set stays a live search); the copy is named "<name> copy" unless newName is given. Running it again adds another copy.

Inputs

Input Type Default What it does
selectionSet required SelectionSet — The set to copy.
newName string "" Name for the copy (empty uses "<name> copy").
document Document null The document (defaults to the active document).

Outputs

Output Type What it gives
selectionSet SelectionSet The new stored set.

Tags: selection set duplicate copy clone backup

SelectionSet.Info

What a saved set is: its name, whether it is a fixed "selection" or a live "search" set, how many items it selects right now (a search set is evaluated once to count; turn includeCount off when you only need the name, kind or folder of many sets) and its folder path ("" at the top level). Read again on every run.

Inputs

Input Type Default What it does
selectionSet required SelectionSet — The selection or search set.
includeCount boolean true True (default) counts the items the set selects, which evaluates a search set against the model; false leaves itemCount empty and skips that work, so reading only the name, kind or folder of many sets is fast.
document Document null The document (defaults to the active document).

Outputs

Output Type
name string
kind string
itemCount integer
folder string

Returns: The set's name, its kind ("selection" or "search"), how many items it selects (empty when includeCount is off) and its folder path.

Tags: selection set info kind count size folder search set audit

SelectionSet.Items

The model items a saved set selects. Search sets are re-evaluated against the model, and the set is read again on every run, so the result follows the set as it is now.

Inputs

Input Type Default What it does
selectionSet required SelectionSet — The selection or search set.
document Document null The document (defaults to the active document).

Outputs

Output Type What it gives
items ModelItem[] The items the set currently selects (search sets are evaluated).

Tags: selection set items contents resolve

SelectionSet.MoveToFolder

Moves a saved selection or search set into a folder (appended at the end). A set already in the folder is left alone, so re-runs are clean. A list of sets moves each of them; a list of sets with a list of folders pairs them one by one.

Inputs

Input Type Default What it does
selectionSet required any — The set, or its display name.
folder required any — The target folder (e.g. from SelectionSets.CreateFolder), or its name.
document Document null The document (defaults to the active document).

Outputs

Output Type What it gives
selectionSet SelectionSet The moved stored set (pass-through for chaining).

Tags: selection set move folder organize

SelectionSet.Name

The display name of a saved selection or search set.

Inputs

Input Type Default What it does
selectionSet required SelectionSet — The selection or search set.

Outputs

Output Type What it gives
name string The set's display name.

Tags: selection set name displayname

SelectionSet.Rename

Renames a saved selection or search set (accepts the set or its current name; searches folders too). Batch-rename by wiring a list of sets and a list of new names: they are paired one by one.

Inputs

Input Type Default What it does
selectionSet required any — The set, or its current display name.
newName required string — The new display name.
document Document null The document (defaults to the active document).

Outputs

Output Type What it gives
selectionSet SelectionSet The renamed stored set (pass-through for chaining).

Tags: selection set rename name batch

SelectionSets.All

All saved selection and search sets in a document, including those inside folders. Re-reads the Sets window on every run, so a set added or removed since the last run shows up.

Inputs

Input Type Default What it does
document Document null The document (defaults to the active document).

Outputs

Output Type What it gives
selectionSets SelectionSet[] Every set, including those nested in folders.

Tags: selection sets saved search all

SelectionSets.BulkByPropertyValues

One search set per distinct value of a property (e.g. one set per Level) — bulk set generation without the Find Items dialog. A value that is stored as text in one file and as a number in another gets ONE set that finds both. The sets come in value order (numbers by size, so 2 before 10). Existing same-named sets in the target folder are replaced; the folder can be a path such as "By Level/Walls". Reads the property of every item that carries it once.

Inputs

Input Type Default What it does
categoryName required string — Category display name (e.g. "Element"). Internal names do not match.
propertyName required string — Property display name (e.g. "Level"). Internal names do not match.
folderName string null Folder to file the sets under: a name, or a path such as "By Level/Walls" (folders that do not exist yet are created). Null or empty stores them at the top level.
document Document null The document (defaults to the active document).

Outputs

Output Type
selectionSets ModelItemCollection[]
values any

Returns: The stored sets and the distinct values, index-aligned.

Tags: selection sets bulk generate values level system

SelectionSets.CreateFolder

Creates a folder in the Sets window, optionally nested under a parent folder. An existing same-named folder in that location is reused, so re-runs are clean. Inside a node group every instance uses the same name unless you wire it in, so two instances share one folder.

Inputs

Input Type Default What it does
name required string — The folder's display name.
parentFolder FolderItem null Parent folder for nesting (null creates at the top level).
document Document null The document (defaults to the active document).

Outputs

Output Type What it gives
folder FolderItem The stored folder (an existing same-named folder in that location is reused).

Tags: selection sets folder create organize nested

SelectionSets.DeleteFolder

Deletes a Sets window folder. A folder that still holds sets or folders is refused with a message unless deleteContents is on, which deletes everything inside it as well — a run has no single undo, so check the folder first with SelectionSets.InFolder. Returns false when there is no such folder, so a clean-up graph can run again safely.

Inputs

Input Type Default What it does
folder required any — The folder to delete: a folder object, its name or a path such as "Walls/Level 1".
deleteContents boolean false False (default) refuses to delete a folder that still holds sets or folders; true deletes the folder together with everything inside it.
document Document null The document (defaults to the active document).

Outputs

Output Type What it gives
deleted boolean True when a folder was deleted; false when there is no such folder.

Tags: selection sets folder delete remove clean organize

SelectionSets.InFolder

All saved selection and search sets inside a folder, in Sets window order. Give it a folder object (SelectionSets.CreateFolder / SelectionSet.Info), a folder NAME, or a path like "Walls/Level 1" to pick between same-named folders; leave it empty for the top level. Nested subfolders are included unless recursive is off. A list of folders gives one result per folder (List Levels are not needed). Feeds straight into SelectionSet.Items, SelectionSet.Info or a Loop.Item. Re-reads the Sets window on every run.

Inputs

Input Type Default What it does
folder any null The folder to read: a folder object, its name, a path such as "Walls/Level 1", or empty for the top level of the Sets window.
recursive boolean true True (default) includes sets in nested subfolders; false lists only the folder's direct children.
document Document null The document (defaults to the active document).

Outputs

Output Type
selectionSets ModelItemCollection[]
names string[]
subfolders any
count integer

Returns: The sets in tree order, their names, the subfolders met on the way, and how many sets were found.

Tags: selection sets folder contents children list inside all

SelectionSets.RenameFolder

Renames a Sets window folder (accepts the folder, its current name or a path like "Walls/Level 1"; searches nested folders too). A list of folders with a list of new names renames them pair by pair.

Inputs

Input Type Default What it does
folder required any — The folder (e.g. from SelectionSets.CreateFolder), its current name, or a path such as "Walls/Level 1".
newName required string — The new folder name.
document Document null The document (defaults to the active document).

Outputs

Output Type What it gives
folder FolderItem The renamed stored folder (pass-through for chaining).

Tags: selection sets folder rename name organize

SelectionSets.SortFolder

Sorts a Sets window folder's contents alphabetically by name (A to Z, ignoring case; entries with the same name keep their order) so you never drag sets into order again. Give a folder object, a folder name or a path like "Walls/Level 1"; leave it empty to sort the top level, and turn recursive on to sort the nested folders too. Folders are sorted among the sets by name. A folder that is already in order is not touched, so re-runs are clean.

Inputs

Input Type Default What it does
folder any null The folder to sort: a folder object, its name or a path; empty sorts the top level.
recursive boolean false True to also sort every nested folder.
document Document null The document (defaults to the active document).

Outputs

Output Type What it gives
folder FolderItem The sorted folder (null when the top level was sorted).

Tags: selection sets folder sort alphabetical order organize arrange