首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何将所有的墙都涂成黑色

如何将所有的墙都涂成黑色
EN

Stack Overflow用户
提问于 2020-06-16 21:15:08
回答 1查看 36关注 0票数 0

我想用Pyrevit为Revit中的一些元素上色:所有的墙都是黑色的,窗户是绿色的,门是粉红色的。

我找到了这个解决方案,但它不起作用:

代码语言:javascript
复制
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']

愿你能帮助我!!非常感谢。问候

EN

回答 1

Stack Overflow用户

发布于 2020-06-18 00:40:37

你真走运!

Building Coder刚刚讨论了一种简单的change the element colour in a view方法。

这应该正好符合你的要求。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62409426

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档