AllowElement Method


Override this pre-filter method to specify if the element should be permitted to be selected.

Namespace: Autodesk.Revit.UI.Selection
Assembly: RevitAPIUI (in RevitAPIUI.dll) Version: 2015.0.0.0 (2015.0.0.0)

Syntax

C#
bool AllowElement(
	Element elem
)
Visual Basic
Function AllowElement ( _
	elem As Element _
) As Boolean
Visual C++
bool AllowElement(
	Element^ elem
)

Parameters

elem
Type: Autodesk.Revit.DB Element
A candidate element in selection operation.

Return Value

Return true to allow the user to select this candidate element. Return false to prevent selection of this element.

Remarks

If prompting the user to select an element from a Revit Link instance, the element passed here will be the link instance, not the selected linked element. Access the linked element from Reference passed to the AllowReference() callback of ISelectionFilter.

If an exception is thrown from this method, the element will not be permitted to be selected.

See Also