BlenderBIM import error

While trying to import a file to Blender using I am getting this error:

Traceback (most recent call last):
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\bim\module\project\operator.py", line 594, in execute
ifc_importer.execute()
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\bim\import_ifc.py", line 253, in execute
self.create_spatial_elements()
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\bim\import_ifc.py", line 684, in create_spatial_elements
self.create_generic_elements(self.spatial_elements)
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\bim\import_ifc.py", line 703, in create_generic_elements
self.create_product(element)
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\bim\import_ifc.py", line 914, in create_product
self.set_matrix_world(obj, self.apply_blender_offset_to_matrix_world(obj, self.get_element_matrix(element)))
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\bim\import_ifc.py", line 1729, in get_element_matrix
result = ifcopenshell.util.placement.get_local_placement(element.ObjectPlacement)
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\util\placement.py", line 55, in get_local_placement
parent = get_local_placement(plc.PlacementRelTo)
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\util\placement.py", line 52, in get_local_placement
if plc.PlacementRelTo is None:
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\entity_instance.py", line 180, in getattr
raise AttributeError(
AttributeError: entity instance of type 'IFC4.IfcAxis2Placement3D' has no attribute 'PlacementRelTo'
Error: Python: Traceback (most recent call last):
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\bim\module\project\operator.py", line 594, in execute
ifc_importer.execute()
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\bim\import_ifc.py", line 253, in execute
self.create_spatial_elements()
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\bim\import_ifc.py", line 684, in create_spatial_elements
self.create_generic_elements(self.spatial_elements)
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\bim\import_ifc.py", line 703, in create_generic_elements
self.create_product(element)
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\bim\import_ifc.py", line 914, in create_product
self.set_matrix_world(obj, self.apply_blendTraceback (most recent call last):
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\bim\module\project\operator.py", line 535, in execute
bpy.ops.bim.load_project_elements()
File "C:\Program Files\Blender Foundation\Blender 3.5\3.5\scripts\modules\bpy\ops.py", line 113, in call
ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Error: Python: Traceback (most recent call last):
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\bim\module\project\operator.py", line 594, in execute
ifc_importer.execute()
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\bim\import_ifc.py", line 253, in execute
self.create_spatial_elements()
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\bim\import_ifc.py", line 684, in create_spatial_elements
self.create_generic_elements(self.spatial_elements)
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\bim\import_ifc.py", line 703, in create_generic_elements
self.create_product(element)
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\bim\import_ifc.py", line 914, in create_product
self.set_matrix_world(obj, self.apply_blender_offset_to_matrix_world(obj, self.get_element_matrix(element)))
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\bim\import_ifc.py", line 1729, in get_element_matrix
result = ifcopenshell.util.placement.get_local_placement(element.ObjectPlacement)
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\util\placement.py", line 55, in get_local_placement
parent = get_local_placement(plc.PlacementRelTo)
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\util\placement.py", line 52, in get_local_placement
if plc.PlacementRelTo is None:
File "C:\Users\nameless\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\entity_instance.py", line 180, in getattr
raise AttributeError(
AttributeError: entity instance of type 'IFC4.IfcAxis2Placement3D' has no attribute 'PlacementRelTo'
Location: C:\Program Files\Blender Foundation\Blender 3.5\3.5\scripts\modules\bpy\ops.py:113

I don't quite understand why because the IfcAxistoPlacement3D seems to be ok... this is a file that was generated by a python app that I am developing. Any clue on what it can be?

Sorry If I made any inconvinient mistake on how to post this here :D

Comments

  • Your model is invalid. It contains a number of errors, but the error you've highlighted is how you've got an object placement (i.e. an IfcLocalPlacement) pointing relative to a Axis2Placement3D ... instead of another IfcLocalPlacement.

    2023-08-14 12:44:09,981    ERROR validate.py 401 For instance:
        #9=IfcOwnerHistory(#7,#8,.READWRITE.,.ADDED.,20230813,#4,#6,20230813)
                                                              ^^             
    With attribute:
        <attribute LastModifyingUser?: <entity IfcPersonAndOrganization>>
    Value:
        #4=IfcPerson('0x8e93A06e953e38eAfC7771eE62932CA49C484299','family','given',$,$,$,$,$)
    Not valid
    
    2023-08-14 12:44:09,981    ERROR validate.py 401 For instance:
        #9=IfcOwnerHistory(#7,#8,.READWRITE.,.ADDED.,20230813,#4,#6,20230813)
                                                                 ^^          
    With attribute:
        <attribute LastModifyingApplication?: <entity IfcApplication>>
    Value:
        #6=IfcOrganization('University of Minho','DiCE @ ISISE','Digitalisation for Construction Enhancement - Institute for Sustainability and Innovation in Structural Engineering',$,$)
    Not valid
    
    2023-08-14 12:44:09,983    ERROR validate.py 401 For instance:
        #50=IfcLocalPlacement(#33,#34)
                              ^^^     
    With attribute:
        <attribute PlacementRelTo?: <entity IfcObjectPlacement>>
    Value:
        #33=IfcAxis2Placement3D(#28,#21,#22)
    Not valid
    
    2023-08-14 12:44:09,983    ERROR validate.py 401 For instance:
        #51=IfcLocalPlacement(#34,#35)
                              ^^^     
    With attribute:
        <attribute PlacementRelTo?: <entity IfcObjectPlacement>>
    Value:
        #34=IfcAxis2Placement3D(#29,#23,#24)
    Not valid
    
    2023-08-14 12:44:11,582    ERROR rule_executor.py 243 On instance:
        #1=IfcProject('0UZBxFsCz7rfzd1oImTVWV',#9,$,$,$,$,$,(#45,#37),#17)
    Rule IfcProject.HasName:
        exists(self.Name)
    Violated by:
        False
         +  where False = exists(None)
         +    where None = #1=IfcProject('0UZBxFsCz7rfzd1oImTVWV',#9,$,$,$,$,$,(#45,#37),#17).Name
    
  • Hi @Moult
    I guess sometimes we need a break from coding haha Can you share more about how to validate the IFC file to get the report in the way you did? I guess this will be very helpful in the future. I just fixed the code and now everything is working, thanks so much for your help :)

  • In the Debug panel in the scene properties, you can load your model and press the "tick" icon. The debug logs will be printed to console (so you'll need to show the console to see the results).

    Arv
  • Interesting, I will make sure to use that more, thanks for sharing.
    I imported this empty file to Blender and imported another IFC file from Revit, I tried to copy/paste some walls from the Revit IFC file to the building storey of the "empty" IFC file, but with no success in the export, it only exports the original IFC empty file with no walls. Is this possible to do with Blender? Can we copy/paste geometries/info from one file to another?
    I don't know if this should move to another topic of discussion..

  • You can copy paste objects from another model using the new "append by query" feature in Project Setup > Project Library in the latest unstable release.

    Don't use Ctrl-C and Ctrl-V between Blender sessions because that only copies and pastes Blender objects, not IFC objects.

    Note that you're not importing or exporting IFCs, you're working with IFC natively.

    Arvtheoryshaw
Sign In or Register to comment.