|
有没有大神帮忙解答。
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
clr.AddReference("System")
from System.Collections.Generic import List
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
import itertools
elementlist = []
doc = DocumentManager.Instance.CurrentDBDocument
linkdocs = DocumentManager.Instance.CurrentUIApplication.Application.Documents
#looks for links in the active project, add instances to a list
for linkdoc in linkdocs:
if linkdoc.IsLinked:
collector = FilteredElementCollector(linkdoc)
filter = ElementCategoryFilter(BuiltInCategory.OST_CableTrayCurveType)
elementlist.append(collector.WherePasses(filter).WhereElementIsNotElementType().ToElements())
#for elem in elementlist:
# options = Options()
# elem.get_Geometry(options)
OUT = list(itertools.chain(*elementlist))
|
|