Changing elements' colors

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!

Comments

  • 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
    theoryshawAce
  • @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!

  • 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

  • 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

  • thanks @Andrej730

    You can create new styles and assign them to the representation items

    something new to practice over next weekend :)

    Nigel
  • edited March 9

    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?

  • edited March 10

    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?

  • @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

    steverugi
Sign In or Register to comment.