📜  获取所有视口类型 dynamo revit - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:50.103000             🧑  作者: Mango

代码示例1
import clr
# Import RevitAPI
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

# Import DocumentManager and TransactionManager
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)

doc = DocumentManager.Instance.CurrentDBDocument


collection = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Viewports).WhereElementIsNotElementType().ToElements()

vptypes = []
for e in collection:
    if e.Category != None:
        vptypes.append(e.ToDSType(True))

OUT = vptypes