Selection Class


Selection Class

Contains the current user selection of elements within the project.
Inheritance Hierarchy
System Object
Autodesk.Revit.UI.Selection Selection

Namespace: Autodesk.Revit.UI.Selection
Assembly: RevitAPIUI (in RevitAPIUI.dll) Version: 25.3.0.0 (25.3.0.0)
Syntax
public class Selection : IDisposable

The Selection type exposes the following members.

Properties
Name Description
Public property IsValidObject Specifies whether the .NET object represents a valid Revit entity.
Top
Methods
Name Description
Public method Dispose Releases all resources used by the Selection
Public method Equals Determines whether the specified object is equal to the current object.
(Inherited from Object )
Public method GetElementIds Returns the ids of the elements that are currently selected within the project. The selection may not be complete. See GetReferences for more options.
Public method GetHashCode Serves as the default hash function.
(Inherited from Object )
Public method GetReferences Returns the references that are currently selected.
Public method GetType Gets the Type of the current instance.
(Inherited from Object )
Public method PickBox(PickBoxStyle) Invokes a general purpose two-click editor that lets the user to specify a rectangular area on the screen.
Public method PickBox(PickBoxStyle, String) Invokes a general purpose two-click editor that lets the user to specify a rectangular area on the screen.
Public method PickElementsByRectangle Prompts the user to select multiple elements by drawing a rectangle.
Public method PickElementsByRectangle(ISelectionFilter) Prompts the user to select multiple elements by drawing a rectangle which pass a customer filter.
Public method PickElementsByRectangle(String) Prompts the user to select multiple elements by drawing a rectangle while showing a custom status prompt string.
Public method PickElementsByRectangle(ISelectionFilter, String) Prompts the user to select multiple elements by drawing a rectangle which pass a customer filter while showing a custom status prompt string.
Public method PickObject(ObjectType) Prompts the user to select one object.
Public method PickObject(ObjectType, ISelectionFilter) Prompts the user to select one object which passes a custom filter.
Public method PickObject(ObjectType, String) Prompts the user to select one object while showing a custom status prompt string.
Public method PickObject(ObjectType, ISelectionFilter, String) Prompts the user to select one object which passes a custom filter while showing a custom status prompt string.
Public method PickObjects(ObjectType) Prompts the user to select multiple objects.
Public method PickObjects(ObjectType, ISelectionFilter) Prompts the user to select multiple objects which pass a customer filter.
Public method PickObjects(ObjectType, String) Prompts the user to select multiple objects while showing a custom status prompt string.
Public method PickObjects(ObjectType, ISelectionFilter, String) Prompts the user to select multiple objects which pass a custom filter while showing a custom status prompt string.
Public method PickObjects(ObjectType, ISelectionFilter, String, IList Reference )
Public method PickPoint Prompts the user to pick a point on the active work plane.
Public method PickPoint(ObjectSnapTypes) Prompts the user to pick a point on the active work plane using specified snap settings.
Public method PickPoint(String) Prompts the user to pick a point on the active work plane while showing a custom status prompt string.
Public method PickPoint(ObjectSnapTypes, String) Prompts the user to pick a point on the active work plane using specified snap settings while showing a custom status prompt string.
Public method SetElementIds
Public method SetReferences
Public method ToString Returns a string that represents the current object.
(Inherited from Object )
Top
Remarks
The Selection object is used to retrieve the current user selected elements when an external API command is executed.
See Also