-
Notifications
You must be signed in to change notification settings - Fork 0
/
GetLinkedElementByCategory.py
50 lines (39 loc) · 1.22 KB
/
GetLinkedElementByCategory.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
"""
---> GET LINK DOCUMENTS <---
__author__ = 'Onur Korkmaz';
"""
import System
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
LinkDoc=IN[0]
cat = IN[1]
LinkInst = IN[2]
BuiltIn = System.Enum.ToObject(BuiltInCategory, cat.Id)
elementlist = []
typelist=[]
T = []
collector = FilteredElementCollector(LinkDoc)
filter = ElementCategoryFilter(BuiltIn)
list=collector.WherePasses(filter).WhereElementIsNotElementType().ToElements()
OUT = list