Created
April 23, 2018 10:47
-
-
Save alvpickmans/aab2e25275423d57e69dc5677dee9d11 to your computer and use it in GitHub Desktop.
Dynamo Script to retrieve all elements by category and view from Revit.
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
# To be pasted in a Dynamo Python Script node. | |
import clr | |
clr.AddReference('RevitAPI') | |
from Autodesk.Revit.DB import * | |
clr.AddReference("RevitServices") | |
import RevitServices | |
from RevitServices.Persistence import DocumentManager | |
import System | |
doc = DocumentManager.Instance.CurrentDBDocument | |
category = UnwrapElement(IN[0]) | |
bic = System.Enum.ToObject(BuiltInCategory, category.Id.IntegerValue) | |
view = UnwrapElement(IN[1]) | |
OUT = FilteredElementCollector(doc, view.Id).OfCategory(bic).ToElements() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment