Pick Point Methods
The PickPoint and PickPoints methods allow users to interactively select points in the Revit model space. These methods are part of the Launchpad UI class and provide a simple way to get coordinates.
PickPoint Method
Description
Syntax
csharppublic XYZ PickPoint(string promptMessage = "Pick a point:", bool showTaskDialog = true)Parameters
Returns
Example Usage
// Basic usage - pick a single point with default prompt
XYZ point = UI.PickPoint();
if (point != null)
{
Console.WriteLine($"Selected point: X={point.X:F2}, Y={point.Y:F2}, Z={point.Z:F2}");
}
// Custom prompt message
XYZ insertionPoint = UI.PickPoint("Select insertion point for family:");
if (insertionPoint != null)
{
// Place family at selected point
doc.Create.NewFamilyInstance(insertionPoint, familySymbol, StructuralType.NonStructural);
}
// Skip confirmation dialog for faster workflow
XYZ quickPoint = UI.PickPoint("Click to place marker:", false);
// Calculate distance between two points
XYZ startPoint = UI.PickPoint("Pick start point:");
XYZ endPoint = UI.PickPoint("Pick end point:");
if (startPoint != null && endPoint != null)
{
double distance = startPoint.DistanceTo(endPoint);
Console.WriteLine($"Distance: {distance:F2} feet");
}PickPoints Method
Description
Syntax
Parameters
Returns
Example Usage
Last updated