public XYZ PickPoint( ObjectSnapTypes snapSettings, string statusPrompt )
The point picked by user.
Note: if the user cancels the operation (for example, through ESC), the method will throw an OperationCanceledException instance.
| Exception | Condition |
|---|---|
| ArgumentNullException | Thrown when the argument statusPrompt is null. |
| InvalidOperationException | Thrown when no work plane set in current view. |
| 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. |
Note: this method must not be called during dynamic update, otherwise ForbiddenForDynamicUpdateException will be thrown.
public void PickPoint(UIDocument uidoc) { ObjectSnapTypes snapTypes = ObjectSnapTypes.Endpoints | ObjectSnapTypes.Intersections; XYZ point = uidoc.Selection.PickPoint(snapTypes, "Select an end point or intersection"); string strCoords = "Selected point is " + point.ToString(); TaskDialog.Show("Revit", strCoords); }
Public Sub PickPoint(uidoc As UIDocument) Dim snapTypes As ObjectSnapTypes = ObjectSnapTypes.Endpoints Or ObjectSnapTypes.Intersections Dim point As XYZ = uidoc.Selection.PickPoint(snapTypes, "Select an end point or intersection") Dim strCoords As String = "Selected point is " & point.ToString() TaskDialog.Show("Revit", strCoords) End Sub