Skip to content

IfcElementAssembly | error if element is voided #7861

@steverugi

Description

@steverugi

Bug Description

  1. have an IfcWall and an IfcCovering
  2. select them both
  3. go to Object Information > Object > Aggregates > + to add an IfcElementAssembly

case 1: the wall has no void => OK
case 2: the wall has a void from door or window => error (see below)

thanks

Attachments

No response

Debug and Error Output

os: Windows
os_version: 10.0.19045
python_version: 3.13.9
architecture: ('64bit', 'WindowsPE')
machine: AMD64
processor: AMD64 Family 23 Model 96 Stepping 1, AuthenticAMD
blender_version: 5.1.0
bonsai_version: 0.8.5-alpha260323
bonsai_commit_hash: 23ba9e4
bonsai_commit_date: 2026-03-23T23:00:12Z
last_actions: 
# operator: BIM_OT_add_aggregate
# operator: BIM_OT_assign_class
# ifcopenshell.api: root.create_entity
>>> {"ifc_class": "IfcElementAssembly", "predefined_type": "", "name": "Wall"}
# ifcopenshell.api: owner.create_owner_history
>>> {}
# ifcopenshell.api: geometry.edit_object_placement
>>> {"product": {"cast_type": "entity_instance", "value": 358, "Name": "Wall"}, "matrix": {"cast_type": "ndarray", "value": [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]]}}
# ifcopenshell.api: owner.update_owner_history
>>> {"element": {"cast_type": "entity_instance", "value": 358, "Name": "Wall"}}
# ifcopenshell.api: spatial.assign_container
>>> {"products": [{"cast_type": "entity_instance", "value": 358, "Name": "Wall"}], "relating_structure": {"cast_type": "entity_instance", "value": 39, "Name": "My Storey"}}
# ifcopenshell.api: aggregate.unassign_object
>>> {"products": [{"cast_type": "entity_instance", "value": 358, "Name": "Wall"}]}
# ifcopenshell.api: owner.update_owner_history
>>> {"element": {"cast_type": "entity_instance", "value": 71, "Name": null}}
# ifcopenshell.api: geometry.edit_object_placement
>>> {"product": {"cast_type": "entity_instance", "value": 358, "Name": "Wall"}, "matrix": {"cast_type": "ndarray", "value": [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]]}, "is_si": "False"}
# ifcopenshell.api: owner.update_owner_history
>>> {"element": {"cast_type": "entity_instance", "value": 358, "Name": "Wall"}}
# ifcopenshell.api: spatial.assign_container
>>> {"products": [{"cast_type": "entity_instance", "value": 358, "Name": "Wall"}], "relating_structure": {"cast_type": "entity_instance", "value": 39, "Name": "My Storey"}}
# ifcopenshell.api: aggregate.assign_object
>>> {"products": [{"cast_type": "entity_instance", "value": 70, "Name": "Wall"}], "relating_object": {"cast_type": "entity_instance", "value": 358, "Name": "Wall"}}
# ifcopenshell.api: spatial.unassign_container
>>> {"products": [{"cast_type": "entity_instance", "value": 70, "Name": "Wall"}]}
# ifcopenshell.api: owner.update_owner_history
>>> {"element": {"cast_type": "entity_instance", "value": 71, "Name": null}}
# ifcopenshell.api: owner.create_owner_history
>>> {}
# ifcopenshell.api: geometry.edit_object_placement
>>> {"product": {"cast_type": "entity_instance", "value": 70, "Name": "Wall"}, "matrix": {"cast_type": "ndarray", "value": [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]]}, "is_si": "False"}
# ifcopenshell.api: owner.update_owner_history
>>> {"element": {"cast_type": "entity_instance", "value": 70, "Name": "Wall"}}
# ifcopenshell.api: owner.update_owner_history
>>> {"element": {"cast_type": "entity_instance", "value": 293, "Name": "Door"}}
# ifcopenshell.api: spatial.assign_container
>>> {"products": [{"cast_type": "entity_instance", "value": 358, "Name": "Wall"}], "relating_structure": {"cast_type": "entity_instance", "value": 39, "Name": "My Storey"}}
last_error: Traceback (most recent call last):
  File "C:\Users\steve\AppData\Roaming\Blender Foundation\Blender\5.1\extensions\.local\lib\python3.13\site-packages\bonsai\bim\ifc.py", line 523, in execute_ifc_operator
    result = getattr(operator, "_execute")(context)
  File "C:\Users\steve\AppData\Roaming\Blender Foundation\Blender\5.1\extensions\.local\lib\python3.13\site-packages\bonsai\bim\module\aggregate\operator.py", line 220, in _execute
    bonsai.core.spatial.assign_container(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        tool.Ifc,
        ^^^^^^^^^
    ...<3 lines>...
        objs=[aggregate],
        ^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\steve\AppData\Roaming\Blender Foundation\Blender\5.1\extensions\.local\lib\python3.13\site-packages\bonsai\core\spatial.py", line 70, in assign_container
    collector.assign(ifc.get_object(element))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\steve\AppData\Roaming\Blender Foundation\Blender\5.1\extensions\.local\lib\python3.13\site-packages\bonsai\tool\collector.py", line 32, in assign
    for users_collection in obj.users_collection:
                            ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'users_collection'

blend_file_path: Not saved
blend_file_dirty: N/A
ifc_file_path: No IFC loaded
ifc_is_dirty: N/A
ifc: Unsaved
schema: IFC4
preprocessor_version: IfcOpenShell 0.8.5-alpha260323
originating_system: IfcOpenShell 0.8.5-alpha260323

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions