【问题标题】:Direct Shape Import material quirk, Material Color is invalid via API until material is edited via UI直接形状导入材质怪癖,材质颜色通过 API 无效,直到通过 UI 编辑材质
【发布时间】:2017-12-02 04:51:38
【问题描述】:
 - Testing in Revit 2017 
 - Dynamo Python node (/ revit lookup / any API call)

说明

我想查询材质的颜色属性。该材质是从 Rhino 3dm(DirectShape Import)自动生成的材质。 Color 属性应该是图层颜色,这在查看材质浏览器及其渲染方式时适用。但是,通过 Revit API 查询它会导致颜色属性无效。

在您主动使用 ui 材质浏览器并修改材质之前,从直接形状存储在材质中的颜色参数未正确初始化/出错。在那之前,使用 API(你可以用 revit 查找测试)来获取材质颜色返回一个无效的颜色,使得检索 rgb 值是不可能的

但是通过 Ui 编辑材质,例如编辑表面图案或颜色...这会以某种方式刷新颜色参数,并允许之后使用 revit API 读取颜色参数。

到目前为止我尝试过的事情

 + Updating another property (such as surface pattern / color) via the API, doesn't do the same as when updating via the UI material browser
 + Doc.Regenerate() after updating the property. (No changes)
 + tried getting built in parameter'doc.GetElement(ElementId(28736714)).Parameter[BuiltInParameter.MATERIAL_PARAM_COLOR].AsValueString()' returns blank.
 + tried saving document after updating misc. property via api, doesn't change anything.

想法

 + reading the solids and faces , somehow translating them to brep geometry and recreating the direct shape. in this way one can assign the material IDs to each face. however, geometry faces as far as i know cannot be converted into brep builder faces.

视觉解释

问题的可视化PDF解释可以看这里:https://www.docdroid.net/n2j9Auy/170628-color-direct-shape-material-quirk.pdf.html

【问题讨论】:

    标签: revit-api revitpythonshell


    【解决方案1】:

    您可能还想在官方Dynamo forum 中提出同样的问题,因为 Autodesk Dynamo 人员正在积极监控,他们与 Revit 开发团队有更密切的联系:

    https://forum.dynamobim.com/

    【讨论】:

    • 感谢 Jeremy,我已将其添加到 dynamo 博客中。此外,我得到了一些建议,可以从现有几何图形中重建直接形状,以便可以为每个面分配所需的材质 ID,而不是重命名它们。但是,据我所知,revit 几何面无法转换为 brep builder 曲面/面。
    猜你喜欢
    • 2019-07-25
    • 2015-07-07
    • 2016-07-23
    • 1970-01-01
    • 1970-01-01
    • 2018-06-17
    • 2021-12-11
    • 2018-10-22
    • 1970-01-01
    相关资源
    最近更新 更多