- Testing in Revit 2017
- Dynamo Python node (/ revit lookup / any API call)
我想查询材质的颜色属性。此材质是Rhino 3dm(DirectShape导入)自动生成的材质。 Color属性应该是图层颜色,这在查看材质浏览器及其呈现方式时也适用。但是,通过Revit API查询它会导致无效的颜色属性。
在您主动使用ui材质浏览器并修改材质之前,存储在直接形状的材质中的颜色参数未正确初始化/出错。在此之前,使用API(你可以使用revit lookup测试它)来获取材质颜色返回无效颜色,从而无法检索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.
可以在这里看到Visual PDF对问题的解释:https://www.docdroid.net/n2j9Auy/170628-color-direct-shape-material-quirk.pdf.html
您可能也想在官方Dynamo forum中提出同样的问题,因为Autodesk Dynamo的人员会积极监控,他们与Revit开发团队有更密切的联系: