pyRevit Hacker Basics
🎯LearnRevitAPI Course
✨WPF for pyRevit Course
💻Code Samples
🎁BIM Pure Mini-Course
Here is how to get currently selected elements in Revit UI and convert them to Elements with optional filtering.
#🔷 Get Selected Elements selected_elements = selection.GetElementIds() for e_id in selected_elements: print(e_id) # Convert ElementId to Element e = doc.GetElement(e_id) print(e, e.Category.Name) # Filter Selection if type(e) not in [Wall, Floor]: print('Wrong Element: {}'.format(e)) else: print('Wall/Floor: {}'.format(e))
⌨️ Happy Coding!Erik Frits
/
all-courses
Modular
Links