IfcOpenShell / IfcOpenShell

Open source IFC library and geometry engine
GNU Lesser General Public License v3.0
1.71k stars 687 forks source link

[BlenderBIM] Error when create drawing: RuntimeError: Instance #0 not found #4943

Open vivenHu opened 3 days ago

vivenHu commented 3 days ago

I created my own IfcElementTypes in blenderBIM, and generate a test scene. When I try to create drawing for a 2d plan, I got this error

Python: Traceback (most recent call last):
  File "C:\Users\hwwde\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\blenderbim\bim\module\drawing\operator.py", line 235, in execute
    self.drawing = self.file.by_id(drawing_id)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\hwwde\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\file.py", line 411, in by_id
    return self[id]
           ~~~~^^^^
  File "C:\Users\hwwde\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\file.py", line 396, in __getitem__
    return entity_instance(self.wrapped_data.by_id(key), self)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\hwwde\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\ifcopenshell_wrapper.py", line 4917, in by_id
    return _ifcopenshell_wrapper.file_by_id(self, id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Instance #0 not found

Here's the IFC file I created just faked in txt format: test.txt

Thank you for your help.

Moult commented 3 days ago

I just tested this and it seems to work fine in the latest stable version from blenderbim.org. Are you sure you are loading the .ifc file? Do not load the .blend file.