Face color/material of an IFC model?

I have a coloured IFC (2x3) imported in SU Pro 2024. I thought a simple face.material would give me the material/color attributes. But to my surprise, all the face.material of every face in the model (or any component with an material member in fact) are returning nil.
I looked around for some related issues, but all I could find were some rather old posts saying that SU do not maintain material for IFC but rather associate colours to IFC classes.

Perhaps another newbie question, but how do I actually access to the material/colour of a face as it is printed in the SU viewer through the Ruby API, regardless of the model type?

I can’t confirm but I think IFC 2x3 don’t support materials so It’s probably the reason why you can’t read them.
Maybe @brewsky or @MikeWayzovski can confirm it.

The importer does not map the materials to the faces, there might be some info on the instance level (check with an attribute inspector) but that is only the name of the material, not the texture itself I believe.

Maybe you are viewing the model in color by tag mode?

I’m not sure, but from the top of my head I would say the components are colored with materials which also shows on the contained faces that have no material by themselves?

Thanks all for your inputs (and sorry for the late reply). I did some additional tests and the behaviour is the same for IFC4 models. But Sketchup.active_model.materials was not empty. So after additional digging, it appeared that the materials were indeed at the instance level (the model doesn’t have texture, but the colors were found properly).

Now the question for me is more from a genericity point of view. Is that a pattern exclusive to IFC or shall I expect this for any model? In other words, does looking for materials in a bottom up way (from face to parents) guarantee finding the right one for a face if any?

I think so. Why not?

Great, thanks. I guess I was asking just in case there were some additional exceptions (for IFC or other formats) I Needed to be aware of.