Skip to main content
Solved

IFC_API Reader Reads Diffuse Color as Ambient Color

  • September 6, 2025
  • 1 reply
  • 34 views

iii4625
Contributor
Forum|alt.badge.img+1

Hello,

I've encountered an issue with how color attributes are read by the different IFC readers.

The IFC reader (deprecated) reads a color value as the diffuse color, but the newer IFC_API reader reads the exact same value as the ambient color.

Consequently, when using a writer like the CityGML writer, the diffuse color information is missing, which results in incorrect materials being created in the output file.

Let me show you with a simple IFC example.

When viewed with BIMVision:

 

The color appears correctly as expected.

 

When read with the IFC reader (deprecated):

The geometry has the diffuse color, which is correct.

 

When read with the IFC_API reader:

The geometry has the ambient color instead of diffuse.

 

What is the recommended way to handle this? Do I need to wait for the next version for a fix?

As a temporary workaround, would it be possible to change the ambient color to diffuse color? This seems difficult because in my actual project files, the hierarchical position of the geometry part that has the appearance applied is not always at the root; it varies from case to case.

Any help on this would be appreciated.

Thank you.

Best answer by virtualcitymatt

Oh, thats ultra annoying.

 

There is a way to replace/update appearances. You need a combination of the SharedItemRetriever, AppearanceStyler and SharedItemSetter. 

 

All the appearances have an ID and are stored in a shared "library". This means is features share an ID then you just need to update it once. 

 

Check out the ColorApperanceReplacer which will replace all diffuse colors with a textures of the same color. You can use this as a bit of a guide/template in how it works. 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

virtualcitymatt
Celebrity
Forum|alt.badge.img+47
  • Celebrity
  • Best Answer
  • September 6, 2025

Oh, thats ultra annoying.

 

There is a way to replace/update appearances. You need a combination of the SharedItemRetriever, AppearanceStyler and SharedItemSetter. 

 

All the appearances have an ID and are stored in a shared "library". This means is features share an ID then you just need to update it once. 

 

Check out the ColorApperanceReplacer which will replace all diffuse colors with a textures of the same color. You can use this as a bit of a guide/template in how it works.