Как окрасить все стены в черный цвет - PullRequest
0 голосов
/ 16 июня 2020

Я хочу раскрасить в Revit с помощью Pyrevit некоторые элементы: все стены черным, windows зеленым, а двери розовым.

Я нашел это решение, но оно не работает:

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']

Можете мне помочь !! Большое спасибо. С уважением

1 Ответ

0 голосов
/ 17 июня 2020

Вам повезло!

Строительный кодировщик только что обсудил простой способ изменения цвета элемента в виде .

Это должно точно соответствовать вашему счету.

...