4.10 Prompting UI Selection
Tell me what you need...
User-Selection Workflows
'Select Model Elements' is Limited
The ISelectionFilter Interface
#Boilerplate Code
#You'll also want to import the below namespace to get access
#to the ISelectionFilter interface
from Autodesk.Revit.UI.Selection import *
class MySelectionFilter(ISelectionFilter):
def __init__(self):
pass
def AllowElement(self, element):
if element.Category.Name == "Walls":
return True
else:
return False
def AllowReference(self, element):
return False
selection_filter = MySelectionFilter()
walls = uidoc.Selection.PickElementsByRectangle(selection_filter)
OUT = wallsLast updated
Was this helpful?