Last active
September 30, 2016 13:45
-
-
Save gtalarico/c92e6f4c7d938f953aa95e5fd5569cb4 to your computer and use it in GitHub Desktop.
RevitAPI::Code Snippets::Select All Doors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
SelectDoors | |
Selects All Door Instances | |
TESTED REVIT API: 2015 | 2016 | |
Gui Talarico | |
""" | |
from Autodesk.Revit.UI import TaskDialog | |
from Autodesk.Revit.DB import FilteredElementCollector | |
from Autodesk.Revit.DB import BuiltInCategory, ElementId | |
from System.Collections.Generic import List | |
# Required for collection | |
uidoc = __revit__.ActiveUIDocument | |
doc = __revit__.ActiveUIDocument.Document | |
collector = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Doors) | |
doors = collector.ToElements() | |
# SELECT MIRRORED DOORS | 2015 + 2016 API | |
selection = uidoc.Selection | |
collection = List[ElementId]([door.Id for door in doors]) | |
selection.SetElementIds(collection) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment