Revit Element Selection
Paracore provides specialized support for interacting with Revit elements directly from the UI. This page details how the Revit Pickers work.
🧱 Type-Safe Selection (Picking)
The best way to select elements is to ask for the specific Revit Type you need. Paracore handles the UI, validation, and object retrieval for you.
Logic Flow
- UI: User clicks "Pick Wall" (Paracore knows to filter for Walls).
- Revit: Paracore prompts the user to select a Wall. User cannot select other categories.
- Execution: Paracore retrieves the
Wallobject and injects it into yourParamsclass.
public class Params {
/// Paracore creates a "Pick" button that only accepts Walls
[Select(SelectionType.Element)]
public Wall TargetWall { get; set; }
/// Paracore creates a "Pick" button for Floors
[Select(SelectionType.Element)]
public Floor TargetFloor { get; set; }
}
// Usage in Main.cs - No casting needed!
Println($"Selected Wall Id: {p.TargetWall.Id}");
⚡ Automatic Listing (Element Choice)
The "Magic" of Paracore is how it automatically presents a list of Revit elements to the user based on your code. Instead of picking a single element on screen, Paracore automatically fetches all available elements of that type and presents them as a searchable dropdown.
- Trigger: Simply use a Revit API class (e.g.,
Level,WallType,Material) as a property type. - UI: Paracore generates a searchable dropdown.
- Sync: Click the Compute (🔄) button in the UI to fetch the latest elements from your model.
public class Params {
/// Paracore creates a searched dropdown of all Levels
public Level BaseLevel { get; set; }
/// Paracore creates a list of all Floor Types
public FloorType TargetType { get; set; }
}
🗂️ Multi-Select Lists (Checkboxes)
To allow users to select multiple elements at once, simply wrap the Revit Class in a List<T>. Paracore will automatically generate a Virtualized Checkbox List optimized for large projects.
public class Params {
/// Paracore creates a checkbox list of ALL Walls
public List<Wall> AllWalls { get; set; }
}
🚪 Loadable Families ([RevitElements])
For loadable families (e.g., Doors, Windows, Furniture), the Engine needs to know which category to filter for. Use the [RevitElements] attribute to define the target category.
- Single Selection: Returns one element.
- Multi-Selection: Use
List<T>to return a collection.
public class Params {
/// List all Door Types in the project
[RevitElements(Category = "Doors")]
public List<FamilySymbol> SelectedTypes { get; set; }
/// Select specific Door Instances
[RevitElements(Category = "Doors")]
public List<FamilyInstance> SelectedDoors { get; set; }
}
📍 XYZ (Point Picker)
When you define a parameter of type Autodesk.Revit.DB.XYZ, Paracore automatically generates a Point Picker in the UI.
Logic Flow
- UI: User clicks "Pick Point".
- Revit: Paracore prompts the user to pick a point in the active view.
- Execution: Paracore injects a
new XYZ(x, y, z)object.
public class Params {
/// Pick the insertion point
[Select(SelectionType.Point)]
public XYZ Origin { get; set; }
}
⚙️ Advanced Selection (Reference)
For advanced scenarios (pick any face, pick any edge) where you need geometric precision, you can use the Revit Reference type.
public class Params {
/// Pick a Face (returns Reference)
[Select(SelectionType.Face)]
public Reference FaceRef { get; set; }
/// Pick an Edge (returns Reference)
[Select(SelectionType.Edge)]
public Reference EdgeRef { get; set; }
}
Usage requires manual retrieval within your script:
var element = Doc.GetElement(p.FaceRef);
🏗️ Filtering Selections
You can restrict what the user can select using the [Select] attribute.
| SelectionType | Description |
|---|---|
SelectionType.Element | Select a full element (Default). |
SelectionType.Point | Select a coordinate point in the view. |
SelectionType.Face | Select a specific face of an element. |
SelectionType.Edge | Select a specific edge. |
public class Params {
/// Pick a face to paint
[Select(SelectionType.Face)]
public Reference TargetFace { get; set; }
}
📊 Interaction: Selection via Table
Paracore supports a "Click to Select" workflow for audit results and schedules.
If your script outputs a table (via Table(data)) that contains a column named Id or ElementId, the Paracore Table Tab will automatically make those rows interactive. Clicking a row in the table will immediately Select and Highlight that element within the active Revit session.
Note: Paracore handles the complex StableRepresentation parsing for you, ensuring that references remain valid even if the script execution creates a new transaction.