|
|
Returns a ModelItemCollection that represents the items specified by this Search in document.
Namespace: Autodesk.Navisworks.Api
Assembly: Autodesk.Navisworks.Api (in Autodesk.Navisworks.Api.dll)
Syntax
| Visual Basic |
|---|
Public Function FindAll ( _ document As Document, _ reportProgress As Boolean _ ) As ModelItemCollection |
| C# |
|---|
public ModelItemCollection FindAll( Document document, bool reportProgress ) |
| Visual C++ |
|---|
public: ModelItemCollection^ FindAll( Document^ document, bool reportProgress ) |
Parameters
- document
- Type: Autodesk.Navisworks.Api..::..Document
Document to search
- reportProgress
- Type: System..::..Boolean
true if progress should be reported via normal Application progress reporting
Examples
//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 }
Exceptions
| Exception | Condition |
|---|---|
| System..::..ArgumentNullException | Argument 'document' is null |
| System..::..InvalidOperationException | Search Selection contains explicit items from a different document |
| Autodesk.Navisworks.Api..::..CanceledOperationException | End user cancels operation through progress interface |