我想用Pyrevit在Revit中为某些元素着色:所有黑墙绿色的窗户粉红色的门。
我找到了这个解决方案,但是它不起作用:
Example
"""
All elements of Category
Get all elements of the specified category from Model.
"""
#Imports.
import csv
from Autodesk.Revit.DB import FilteredElementCollector, BuiltInCategory, BuiltInParameter
from Autodesk.Revit import revit,DB
from pyrevit.coreutils import colors
# We will need to access the active document. The UIApplication instance is referenced by the `__revit__` builtin variable, provided by pyRevit execution engine
doc = __revit__.ActiveUIDocument.Document
uidoc = __revit__.ActiveUIDocument
classpyrevit.coreutils.colors.RGB(name='default', red=0, green=0, blue=0):
ALICEBLUE = RGB('aliceblue', 240, 248, 255)
PINK = RGB(name='pink', red=255, green=192, blue=203)
DARKVIOLET = RGB(name='darkviolet', red=148, green=0, blue=211
walls = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Walls).WhereElementIsNotElementType()
for wall in walls
colors.COLORS['pink']
door_collector = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Doors).WhereElementIsNotElementType()
for door in door_collector
colors.COLORS['aliceblue']
window_collector = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Windows).WhereElementIsNotElementType()
for window in window_collector
colors.COLORS['darkviolet']
希望您能帮我!!非常感谢。问候