Is it possible to determine element RGB color with Solibri?
-
Hi. It depends a lot on what you mean by the color.
The Java API does allow access to the component materials (https://solibri.github.io/Developer-Platform/9.12.4/javadoc/com/solibri/smc/api/model/Component.html#getMaterials())
which corresponds to the IfcMaterial (http://standards.buildingsmart.org/IFC/RELEASE/IFC2x3/FINAL/HTML/ifcmaterialresource/lexical/ifcmaterial.htm) but that only has a name, not color.In the Solibri settings there is the possibility to choose what colors are used in the UI for different component. See Settings - Discipline and Color Map. These colors can be completely different from what the IFC determines as colors.
Based on discussion here https://forums.buildingsmart.org/t/where-and-how-will-my-colors-be-saved-in-ifc/1806 it seems that colors in IFC are defined in quite many different ways.
-
@lraimo I did some research about Materials and colours a while back. I am not sure if this will help you, but I can post my findings here. Although the text is in Dutch, you should still be able to read most of the images.
In short: the DataType for colours is an IfcNormalisedRatioMeasure, meaning its value will be between 0 and 1, instead of between 0 and 255 you might be used to for standard RGB.
To my knowledge, there are only a few Predefined colours within IFC:
- Black (0 / 0 / 0) - Red (1.0 / 0 / 0) - Green (0 / 1.0 / 0) - Blue (0 / 0 / 1.0) - Yellow (1.0 / 1.0 / 0) - Magenta (1.0 / 0 / 1.0) - Cyan (0 / 1.0 / 1.0) - White (1.0 / 1.0 / 1.0)So even if it were possible to view these values in Solibri through the API, I think it would be tedious to find and translate all the possible values to AutoCAD colours.
You can find the rest of my findings here: IfcMaterial.pdf
If you find any mistakes I made, please let me know. I’m always curious to learn more about IFC.
-
@b-huijskes
Thanks for the material. Google translate helped to understand it.
I would only need the RGB color assigned to component.
For example this value
0.000000,1.000000,1.000000
From there I could calculate the ACAD color by multiplying them by 255 and using some Excel formulas.
ACAD colors in RGB https://gohtx.com/acadcolors.php -
@lasse-lindqvist
These elements do not have material (no Material tab in Solibri) but somehow all ifc viewer will show the same color.
How does Solibri decides what color it will show the element? And is it possible to get this information using API?
I can send example ifc or smc model if this would help -
@Solibrians
Is there any way to determine element RGB color with Solibri?
Copyright © 2025 Solibri Inc. | Powered by NodeBB