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

Save selection sets

Goal: store search results in the Navisworks Sets window, either as one set or as one set per value of a property.

Before you start

  • Open a model in Navisworks and the CamelGraph editor.
  • Know the tab and property to search by (find the names).

Download the graph

  1. Add a String node (Input), rename it Material text and type Concrete into it.
  2. Add Search.ByProperty (Navisworks ▸ Search). Type Element into categoryName and Material into propertyName, and choose contains for mode. Wire the String into value. That input accepts any kind of value, so it has no box of its own.
  3. Add SelectionSet.Create (Navisworks ▸ SelectionSets). Wire items from the search into its items.
  4. Type Concrete elements into its name input.
  5. Press F5.

The downloadable graph also paints the items red on the way, with Appearance.OverrideColor between the search and SelectionSet.Create (Colour elements by a property), and shows the search result in a Watch List.

The first script: a search, a colour override and SelectionSet.Create named "Concrete elements". The first script: a search, a colour override and SelectionSet.Create named "Concrete elements".
The first script: a search, a colour override and SelectionSet.Create named "Concrete elements".

The set appears in the Navisworks Sets window. SelectionSet.Create replaces a top-level set with the same name, so a second run updates the set instead of adding another. It stores the items that were found when you ran it.

Part B: one set per value

Download the graph

  1. Add SelectionSets.BulkByPropertyValues (Navisworks ▸ SelectionSets).
  2. Type Element into categoryName and Level into propertyName.
  3. Type Levels into folderName. Leave it empty to put the sets at the top level.
  4. Add a Watch List (Display) and wire the values output into it. This shows the distinct values the node found.
  5. Press F5.
The bulk graph: SelectionSets.BulkByPropertyValues with a Watch List for the values. The bulk graph: SelectionSets.BulkByPropertyValues with a Watch List for the values.
The bulk graph: SelectionSets.BulkByPropertyValues with a Watch List for the values.

What you get

  • Part A: a saved selection set with the name you typed.
  • Part B: one search set for every distinct value, filed in the folder you named. A search set is live: it re-evaluates as the model changes. The selectionSets and values outputs are in the same order, so the first set belongs to the first value.
  • Running again replaces sets with the same name in that folder.

Selection set or search set?

SelectionSet.Create keeps the items it was given. SelectionSet.CreateFromSearch and SelectionSets.BulkByPropertyValues keep a rule, so they follow the model when it changes.

If it does not work

Next