|
![]() |
A collection of SearchConditions
Namespace: Autodesk.Navisworks.Api
Assembly: Autodesk.Navisworks.Api (in Autodesk.Navisworks.Api.dll)
Syntax
Visual Basic |
---|
Public Class SearchConditionCollection _ Inherits NativeHandle _ Implements IList(Of SearchCondition), IList, _ ICollection(Of SearchCondition), ICollection, IEnumerable(Of SearchCondition), _ IEnumerable |
C# |
---|
public class SearchConditionCollection : NativeHandle, IList<SearchCondition>, IList, ICollection<SearchCondition>, ICollection, IEnumerable<SearchCondition>, IEnumerable |
Visual C++ |
---|
public ref class SearchConditionCollection : public NativeHandle, IList<SearchCondition^>, IList, ICollection<SearchCondition^>, ICollection, IEnumerable<SearchCondition^>, IEnumerable |
Remarks
This class is used by the property Search.SearchConditions and as part of the following methods:
Examples

using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Windows.Forms; using System.Text; using Autodesk.Navisworks.Api.Controls; static public void SearchPropertyCategoriesForTransformData() { //prepare the output StringBuilder output = new StringBuilder(1000); //Create a new search Search search = new Search(); //Search Condition for Transforms SearchCondition searchCondition = SearchCondition.HasCategoryByName(PropertyCategoryNames.Transform); //This is Equivelent to //SearchCondition searchCondition = // SearchCondition.HasCategoryByDisplayName("Transform"); //add the search condition to the search search.SearchConditions.Add(searchCondition); //set the selection to search everything search.Selection.SelectAll(); search.Locations = SearchLocations.DescendantsAndSelf; //perform the search and get the results in a ModelItemCollection ModelItemCollection results = search.FindAll(Autodesk.Navisworks.Api.Application.ActiveDocument, false); MessageBox.Show(results.Count.ToString()); }

using Autodesk.Navisworks.Api.Controls; //Create a new search Search s = new Search(); //set the selection to everything s.Selection.SelectAll(); //Add a search condition s.SearchConditions.Add(SearchCondition.HasCategoryByName(PropertyCategoryNames.Geometry)); try { //get the resulting collection by applying this search ModelItemCollection searchResults = s.FindAll(Autodesk.Navisworks.Api.Application.ActiveDocument, true); //Select the items in the model that are contained in the collection Autodesk.Navisworks.Api.Application.ActiveDocument.CurrentSelection.CopyFrom(searchResults); } catch (CanceledOperationException) { //the user cancelled the search }
Inheritance Hierarchy
System..::..Object
Autodesk.Navisworks.Api..::..NativeHandle
Autodesk.Navisworks.Api..::..SearchConditionCollection
Autodesk.Navisworks.Api..::..NativeHandle
Autodesk.Navisworks.Api..::..SearchConditionCollection