Skip to content

AttributeError: IfcCompositeProfileDef has no attribute 'OuterCurve' when rotating LAYER3 slab #7885

@theoryshaw

Description

@theoryshaw

Description

Changing the x-rotation angle of a LAYER3 slab crashes with an AttributeError when the element's swept area is an IfcCompositeProfileDef.

Steps to Reproduce

  1. Create or load a LAYER3 slab whose SweptArea is an IfcCompositeProfileDef.
  2. Attempt to rotate it (change x-angle).

Error

File "...bonsai/bim/module/model/wall.py", line 471, in _execute
    coord_list = builder.get_polyline_coords(extrusion.SweptArea.OuterCurve)
AttributeError: entity instance of type 'IFC4.IfcCompositeProfileDef' has no attribute 'OuterCurve'

Expected Behaviour

The rotation applies successfully. IfcCompositeProfileDef holds sub-profiles in its Profiles attribute; each sub-profile has OuterCurve.

Actual Behaviour

Crash — the code unconditionally accesses SweptArea.OuterCurve, which only exists on IfcArbitraryClosedProfileDef.

Python: Traceback (most recent call last):
  File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\4.5\extensions\.local\lib\python3.11\site-packages\bonsai\bim\ifc.py", line 523, in execute_ifc_operator
    result = getattr(operator, "_execute")(context)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\4.5\extensions\.local\lib\python3.11\site-packages\bonsai\bim\module\model\wall.py", line 471, in _execute
    coord_list = builder.get_polyline_coords(extrusion.SweptArea.OuterCurve)
                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\4.5\extensions\.local\lib\python3.11\site-packages\ifcopenshell\entity_instance.py", line 263, in __getattr__
    raise AttributeError(
AttributeError: entity instance of type 'IFC4.IfcCompositeProfileDef' has no attribute 'OuterCurve'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions