直接形状导入材料怪癖,材料颜色通过API无效,直到通过UI编辑材料

问题描述 投票:1回答:1
 - Testing in Revit 2017 
 - Dynamo Python node (/ revit lookup / any API call)

Description

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

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

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

Things I've tried thus far

 + 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.

Ideas

 + 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.

Visual Explanation

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

revit-api revitpythonshell
1个回答
0
投票

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

https://forum.dynamobim.com/

© www.soinside.com 2019 - 2024. All rights reserved.