G
by guieliote on 5 Dec 2023, edited 11 Mar 2024
#
Good morning! I'm relatively new to working with IFC and ifcopenshell, and I could use some assistance. My goal is to create a script that reads an IFC file and applies colorization to elements that have specific properties, such as those indicating recyclability. I've already managed to assign these properties, but I'm having difficulty with the colorization process. Can someone provide guidance or assistance with this aspect of the script? Thank you!
A
by Arv on 5 Dec 2023
#
+2 votes
Coloring element is done through style in ifc
You could try the following
-
filter all the elements that matches specific properties using ifcopenshell.util.selector.filter_elements
. you can refer here
-
create a style and then apply the style on all the filtered elements. refer here
G
by guieliote on 5 Dec 2023
#
@Arv said:
Coloring element is done through style in ifc
You could try the following
- filter all the elements that matches specific properties using
ifcopenshell.util.selector.filter_elements
. you can refer here
- create a style and then apply the style on all the filtered elements. refer here
Thank you so much, I will try this out. I really appreciate the help!
S
by steverugi on 8 Mar 2024
#
Hi @Arv
Coloring element is done through style in ifc
You could try the following
- filter all the elements that matches specific properties using
ifcopenshell.util.selector.filter_elements
. you can refer
- create a style and then apply the style on all the filtered elements. refer
Those links are for programmers, please how about IFC style in BBMI interface? any useful link or procedure? (just to assign IFC color/style to elements that shows in viewers, not just Blender) many thanks
A
by Andrej730 on 8 Mar 2024
#
Those links are for programmers, please how about IFC style in BBMI interface? any useful link or procedure? (just to assign IFC color/style to elements that shows in viewers, not just Blender) many thanks
You can create new styles and assign them to the representation items - https://imgur.com/a/5HpZlMR
S
by steverugi on 8 Mar 2024
#
+1 votes
thanks @Andrej730
You can create new styles and assign them to the representation items
something new to practice over next weekend :)
S
by steverugi on 9 Mar 2024, edited 9 Mar 2024
#
Hi @Andrej730
You can create new styles and assign them to the representation items -
with some little effort (and your help) I now know how to create and assign a style to an entity, thanks
if it's not too much asking: can a style be assigned to a Type or just to selected entities?
As always, I much appreciate the help offered by this platform, cheers
EDIT
I think I found out, in Materials pane you can assign them to a particular Style, since a Type has a material assigned..

is it correct?
S
by steverugi on 10 Mar 2024, edited 10 Mar 2024
#
Hi @Andrej730
please see what I managed so far (didn't use the representation way) to assign material/style to Types instead of selecting elements
Video
is it OK?
A
by Andrej730 on 11 Mar 2024
#
+1 votes
@steverugi said:
Hi @Andrej730
please see what I managed so far (didn't use the representation way) to assign material/style to Types instead of selecting elements
Video
is it OK?
I think it's a bug that was present before this commit - representation wasn't updated after you assigned a new style and it required to either to reload representation manually (Geometry and Materials -> Representations -> "Switch Representation" on active representation) or reload .ifc. Should be fixed now in the latest build - https://imgur.com/a/ykbbmEY