Selection.PickObject(ObjectType, ISelectionFilter, String)
Method
Description:
Prompts the user to select one object which passes a custom filter while showing a custom status prompt string.
Prompts the user to select one object which passes a custom filter while showing a custom status prompt string.
Remarks:
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 Reference PickObject(
ObjectType objectType,
ISelectionFilter selectionFilter,
string statusPrompt
)
Parameters
Parameter | Type | Description |
---|---|---|
objectType | ObjectType | Specifies the type of object to be selected. |
selectionFilter | ISelectionFilter | The selection filter. |
statusPrompt | String | The message shown on the status bar. |
Return Value
Type | Description |
---|---|
Reference | A reference object selected by user. Note: if the user cancels the operation (for example, through ESC), the method will throw an OperationCanceledException instance. |
Exceptions
Exception | Condition |
---|---|
ArgumentOutOfRangeException | Thrown when the objectType is not a recognized value. |
ArgumentNullException | Thrown when the selectionFilter isor statusPrompt is. |
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. |
ForbiddenForDynamicUpdateException | Thrown if this method is called during dynamic update. |