[BlenderBIM] IfcMaterialLayer

edited June 2022 in General

Could someone explain to me how to use the IfcMaterialLayerSet?
I keep getting this error when trying to add an IfcMaterialLayerSet:

location: <unknown location>:-1
Error: Python: Traceback (most recent call last):
  File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\blenderbim\bim\module\material\operator.py", line 156, in execute
    return IfcStore.execute_ifc_operator(self, context)
  File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\blenderbim\bim\ifc.py", line 369, in execute_ifc_operator
    result = getattr(operator, "_execute")(context)
  File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\blenderbim\bim\module\material\operator.py", line 163, in _execute
    ifcopenshell.api.run(
  File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\api\__init__.py", line 72, in run
    listener(usecase_path, ifc_file, settings)
  File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\blenderbim\bim\module\model\product.py", line 345, in ensure_material_assigned
    if material[0].id() in object_material_ids:
IndexError: list index out of range


I'm on BlenderBIM version 0.0.220516

Should I define the values an IfcMaterialLayerSet somewhere else?
Because I don't see any options here:

I want to experiment with the thickness in an IfcMaterialLayerSet.

Comments

  • edited May 2022

    It is a bug. I will fix it :)

    CoenDarth_Blender
  • Sorry looking at this again, it is a bug, but not in the way you think :) Material layers imply that geometry can be parametrically derived from a prismatic extrusion of the layer thicknesses. This means that if you apply material layers to something which already has geometry, it gets confused (this is the bug, it should handle it gracefully).

    Try this:

    1. Shift A > Add Empty Type and assign that Empty to an IfcWallType
    2. Object Properties > IFC Object Material > Add Ifc Material Layer Set material.
    3. Edit the IfcMaterialLayerSet and add a layer by choosing a material from the dropdown. It defaults to a layer thickness of "1" of whatever your project unit is.
    4. Edit the layer thickness to whatever you want.
    5. Activate the BIM Workspace Tool (cube icon in left sidebar)
    6. Choose the wall type you just added. In the viewport, position the 3D cursor where you want to add a wall, and Shift-A to add. It'll be as thick as you specified it. You will also see it "inherits" the layer thickness from the type in its material properties.
    7. Adjust the material layer thickness and save again, and you'll see the wall grow or shrink. Fancy!
    Coen
  • @Moult

    Thank you very much. Amazing stuff! I should test drive this a bit more and make a tutorial about it.

  • @Moult

    I know you can use greasepencil to get typed walls with the joins you want. But yesterday I saw you do it in a different way on the chat. You added walls really fast, also in a perpendicular way without greasepencil. I was looking everywhere on how you did it. Can't find it :(, Seems like such a simple thing that there is no tutorial about it. But I still can't managed to do it. haha.

    My question is , what's a way of modelling these IfcMaterialLayer walls in an accurate way?

  • Yeah unfortunately until authoring stabilises there aren't any docs for those features.

    Shift-A adds the layered object (e.g. wall) along the global X axis positioned at your 3D cursor location. However, if you first select a wall, then place the 3D cursor (Shift-RMB) on that wall's edge, it will be positioned perpendicular to that wall. Always enable multiple snaps when authoring to be accurate. Shift-Tab toggles snapping.

    Coen
  • I tried importing wall types from other IFC files, the IFC schependomlaan
    I have put the IFC file in the folder:
    C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\blenderbim\bim\data\libraries

    I made an IFC2x3 file when creating a project and loading the IFC schependomlaan as the Project Library.

    Now I wanted to use greasepencil to create the wall types

    I get this in the console:

    location: <unknown location>:-1
    Error: Python: Traceback (most recent call last):
      File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\blenderbim\bim\module\model\product.py", line 65, in execute
        return IfcStore.execute_ifc_operator(self, context)
      File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\blenderbim\bim\ifc.py", line 369, in execute_ifc_operator
        result = getattr(operator, "_execute")(context)
      File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\blenderbim\bim\module\model\product.py", line 121, in _execute
        bpy.ops.bim.assign_class(obj=obj.name, ifc_class=instance_class)
      File "C:\Program Files\Blender Foundation\Blender 3.1\3.1\scripts\modules\bpy\ops.py", line 132, in __call__
        ret = _op_call(self.idname_py(), None, kw)
    RuntimeError: Error: Python: Traceback (most recent call last):
      File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\blenderbim\bim\module\root\operator.py", line 39, in execute
        IfcStore.execute_ifc_operator(self, context)
      File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\blenderbim\bim\ifc.py", line 369, in execute_ifc_operator
        result = getattr(operator, "_execute")(context)
      File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\blenderbim\bim\module\root\operator.py", line 140, in _execute
        core.assign_class(
      File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\blenderbim\core\root.py", line 71, in assign_class
        collector.assign(obj)
      File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\blenderbim\tool\collector.py", line 85, in assign
        object_collection.objects.link(obj)
    AttributeError: 'NoneType' object has no attribute 'objects'
    
    location: C:\Program Files\Blender Foundation\Blender 3.1\3.1\scripts\modules\bpy\ops.py:132
    

    Does it work with with IFC2x3, or should I use an IFC4 fo rthis functionality?

  • edited June 2022


    Same "bug?" when trying to create an IfcMaterialLayerSet with an empty in IFC4

    Don't know what I should put in this menu

  • Managed to get some really decent accurate results with roundtripping the thickness of a Wall with IfcMaterialLayerSet

    500mm

    200mm

    Where can the height of the wall be preset when adding the typed wall?

  • I haven't looked into yet, but maybe it's worth asking before I get into it...

    Can the different IfcMaterials in an IfcMaterialLayerSet be visualized with the BlenderBIM add-on?

  • @Coen said:
    I haven't looked into yet, but maybe it's worth asking before I get into it...

    Can the different IfcMaterials in an IfcMaterialLayerSet be visualized with the BlenderBIM add-on?

    Well, I looked into, I can only see one material, am I maybe missing something or is it not possible...yet?

  • I got the grease pencil approach to work with this file, video here.
    ...

    Where can the height of the wall be preset when adding the typed wall?

    I don't believe this is possible yet.
    ...

    Can the different IfcMaterials in an IfcMaterialLayerSet be visualized with the BlenderBIM add-on?

    i don't think anything has changed since your comments here and here. ;)

    +1 issue here. :)

    Coen
  • @Coen said:
    @Moult

    Thank you very much. Amazing stuff! I should test drive this a bit more and make a tutorial about it.

    Do setting these settings also define the hatch type when drawings are create? I've tried adding .ifc materials in the blender materials ui but this doesn't seem to affect how the wall hatch is generated.

  • edited November 2022

    Does this help?: https://www.dropbox.com/s/udyt2wb4l6trly5/2022-11-13_07-23-53_Blender_blender.mp4?dl=0
    I too, intuitively feel the hatch should come from the IfcStyle, as assigned through the IfcMaterial, and not the IfcMaterialLayerSet name... perhaps that's in the roadmap.

    Gorgious
  • It does, thanks. So when we set the material with the layerSetUsage its bound to the wall type? Say I have two walls of the same thickness but different finishes or construction then I'd need to create a separate wall type so we can hatch in the appropriate way?

  • Yes, i think so.

    Ace
Sign In or Register to comment.