OSArch Community

Error Message in Bonsai BIM

  1. S

    Can someone explain this error message from Bonsai BIM?

  1. A

    I'll attach traceback error below to make it more accessible.

    I've investigated a bit and I believe this IFC model is invalid (you can confirm by running IFC validation on it) - it has IfcMaterialLayerSetUsage with unset ForLayerSet attribute (which is not optional and should be pointing to IfcMaterialLayerSet, see https://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/IfcMaterialLayerSetUsage.htm).

    Is this model was authored in Bonsai or it's coming from other software? (traceback suggests that it's coming from Bonsai but elements could be appended from other models)

    Any ideas how I can reproduce this invalid state of IfcMaterialLayerSetUsage?

    
    last_error: Traceback (most recent call last):
    
      File "C:\Users\Xxxxxx\AppData\Roaming\Blender Foundation\Blender\4.3\extensions\.local\lib\python3.11\site-packages\bonsai\bim\ifc.py", line 442, in execute_ifc_operator
    
        result = getattr(operator, "_execute")(context)
    
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
      File "C:\Users\Xxxxxx\AppData\Roaming\Blender Foundation\Blender\4.3\extensions\.local\lib\python3.11\site-packages\bonsai\bim\module\model\product.py", line 481, in _execute
    
        tool.Model.add_filled_opening(building_obj, obj)
    
      File "C:\Users\Xxxxxx\AppData\Roaming\Blender Foundation\Blender\4.3\extensions\.local\lib\python3.11\site-packages\bonsai\tool\model.py", line 1954, in add_filled_opening
    
        FilledOpeningGenerator().generate(filling_obj, voided_obj)
    
      File "C:\Users\Xxxxxx\AppData\Roaming\Blender Foundation\Blender\4.3\extensions\.local\lib\python3.11\site-packages\bonsai\bim\module\model\opening.py", line 91, in generate
    
        layers = tool.Model.get_material_layer_parameters(element)
    
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
      File "C:\Users\Xxxxxx\AppData\Roaming\Blender Foundation\Blender\4.3\extensions\.local\lib\python3.11\site-packages\bonsai\tool\model.py", line 543, in get_material_layer_parameters
    
        if material.is_a("IfcMaterialLayerSet"):
    
           ^^^^^^^^^^^^^
    
    AttributeError: 'NoneType' object has no attribute 'is_a'
    
  1. S

    Hi,

    Model was done in Bonsai and it was quite early stage. I had created doors in separate Bonsai ifc project which works as "door factory". And then importing one of these through project library. And then inserting a door to a wall causes this error.

  1. A

    @Samppa door has no issues in this project, the problem is with IfcWall - it has IfcMaterialLayerSetUsage as it's material but it's not pointing to IfcMaterialLayerSet. Any ideas how to reproduce this kind of invalid IfcWall?

    See validation error below.

    
    2025-03-26:13:50:49,058 ERROR   [validate.py:496] For instance:
    
        #19218=IfcMaterialLayerSetUsage($,.AXIS2.,.POSITIVE.,0.,$)
    
                                        ^
    
    With attribute:
    
        <attribute ForLayerSet: <entity IfcMaterialLayerSet>>
    
    Not optional
    
  1. S

    Thanks. I have no idea how to reproduce this. The ifc file that was attached included only one wall but actually all wall types in the main model are broken in the same way: no object material in them. What I did was reverting to previous file that was ok and continued from there.

Login or Register to reply.