PickObjects
Method
Description:
Prompts the user to select multiple objects which pass a customer filter.
Prompts the user to select multiple objects which pass a customer filter.
Remarks:
The user will be shown "Finish" and "Cancel" buttons on the dialog bar to complete the selection operation. Uncheck the "Multiple" check-box to select single object and it will return the selected object directly.
Revit users will be permitted to manipulate the Revit view (zooming, panning, and rotating the view), but will not be permitted to click other items in the Revit user interface. Users are not permitted to switch the active view, close the active document or Revit application in the pick session, otherwise an exception will be thrown.
The selection will not be automatically added to the active selection buffer.
Note: this method must not be called during dynamic update, otherwise ForbiddenForDynamicUpdateException will be thrown.
Syntax
public IList<Reference> PickObjects(
ObjectType objectType,
ISelectionFilter selectionFilter
)
Parameters
Parameter | Type | Description |
---|---|---|
objectType | Autodesk.Revit.UI.Selection.ObjectType | the type of object to be selected. |
selectionFilter | Autodesk.Revit.UI.Selection.ISelectionFilter | selection filter. |
Return Value
Type | Description |
---|---|
Autodesk.Revit.Exceptions.ArgumentOutOfRangeException | A collection of references selected by the user. Note: if the user cancels the operation (for example, through ESC), the method will throw an OperationCanceledException instance. |
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions.ArgumentOutOfRangeException | Thrown when the objectType is not a recognized value. |
Autodesk.Revit.Exceptions.ArgumentNullException | Thrown when the selectionFilter isnullNothingnullptra null reference (Nothingin Visual Basic). |
Autodesk.Revit.Exceptions.OperationCanceledException | Thrown when the Revit user cancelled this operation. Thrown when the Revit user tried to switch the active view, close the active document or Revit application when responding to this mode. |
Autodesk.Revit.Exceptions.ForbiddenForDynamicUpdateException | Thrown if this method is called during dynamic update. |