Skip to content

Can't bim.remove_drawing a corrupt drawing #8122

@theoryshaw

Description

@theoryshaw

activate Type A2 drawing.
And then try to bim.remove_drawing it.

get the following error.

Highland_Haven - Copy.ifc.txt

os: Windows
os_version: 10.0.19045
python_version: 3.11.11
architecture: ('64bit', 'WindowsPE')
machine: AMD64
processor: Intel64 Family 6 Model 158 Stepping 10, GenuineIntel
blender_version: 4.5.7 LTS
bonsai_version: 0.0.0
bonsai_commit_hash: 7489d08
bonsai_commit_date: 2026-05-29T09:49:27-05:00
bonsai_git_branch: BonsaiPR_base
last_actions: 
# operator: BIM_OT_remove_drawing
last_error: 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 531, 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\drawing\operator.py", line 3287, in _execute
    sheet_references = tool.Drawing.get_sheet_references(drawing)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\4.5\extensions\.local\lib\python3.11\site-packages\bonsai\tool\drawing.py", line 3180, in get_sheet_references
    if reference.Location == drawing_reference.Location:
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'Location'

blend_file_path: D:\Dropbox\Gitea_OD\Highland_Haven\Open\Models_and_CAD\BlenderBIM\temp.blend
blend_file_dirty: True
ifc_file_path: D:/Dropbox/Gitea_OD/Highland_Haven/Open/Models_and_CAD/BlenderBIM/Highland_Haven.ifc
ifc_is_dirty: True
ifc: Highland_Haven.ifc
schema: IFC4
preprocessor_version: IfcOpenShell 0.0.0
originating_system: Bonsai 0.8.6-alpha260529-7489d08

Metadata

Metadata

Assignees

Labels

BonsaiPR ProposedA PR has been proposed for this bug/feature.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions