- Testing in Revit 2017 - Dynamo Python node (/ revit lookup / any API call)
I would like to query a material’s Color Property. This material is an automatically generated material from a Rhino 3dm(DirectShape Import). The Color property should be the layer color and this holds true when looking in the material browser and how its rendered. However, quierying it via the Revit API results in an invalid color property.
The color parameter stored in a material from a direct shape is not properly initialized/errors out until you actively use the ui material browser and modify the material. Until then, using the API (u can test this with revit lookup) to get the material color return an invalid color, making retrieving the rgb value not possible
However edit the material via the Ui, such as editing the surface pattern or color…This somehow refreshes the color parameter and allows one to use the revit API to read the color parameter afterward.
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, doesnt 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 explanation of the problem can be seen here: https://www.docdroid.net/n2j9Auy/170628-color-direct-shape-material-quirk.pdf.html