IfcOpenShell / IfcOpenShell

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

Create a cube and enter Edit mode #4984

Open gvisys opened 3 weeks ago

gvisys commented 3 weeks ago
os: Darwin
os_version: Darwin Kernel Version 23.5.0: Wed May  1 20:16:51 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8103
python_version: 3.11.7
architecture: ('64bit', '')
machine: arm64
processor: arm
blender_version: 4.1.0
blenderbim_version: 0.0.240602
last_actions: 
# ifcopenshell.api: geometry.remove_representation
>>> {"representation": {"cast_type": "entity_instance", "value": 103, "Name": null}}
# ifcopenshell.api: geometry.map_representation
>>> {"representation": {"cast_type": "entity_instance", "value": 164, "Name": null}}
# ifcopenshell.api: owner.update_owner_history
>>> {"element": {"cast_type": "entity_instance", "value": 91, "Name": "EC100"}}
# ifcopenshell.api: style.assign_representation_styles
>>> {"shape_representation": {"cast_type": "entity_instance", "value": 160, "Name": null}, "styles": "[]", "should_use_presentation_style_assignment": "False"}
# ifcopenshell.api: geometry.unassign_representation
>>> {"product": {"cast_type": "entity_instance", "value": 114, "Name": "CableSegment"}, "representation": {"cast_type": "entity_instance", "value": 100, "Name": null}}
# ifcopenshell.api: geometry.remove_representation
>>> {"representation": {"cast_type": "entity_instance", "value": 100, "Name": null}}
# operator: BIM_OT_override_mode_set_edit
# operator: BIM_OT_override_mode_set_edit
# operator: BIM_OT_override_mode_set_edit
# operator: BIM_OT_override_mode_set_edit
last_error: Traceback (most recent call last):
  File "/Users/cesarcruz/Library/Application Support/Blender/4.1/scripts/addons/blenderbim/bim/ifc.py", line 358, in execute_ifc_operator
    result = getattr(operator, "_invoke")(context, None)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cesarcruz/Library/Application Support/Blender/4.1/scripts/addons/blenderbim/bim/module/geometry/operator.py", line 1652, in _invoke
    return self.execute(context)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cesarcruz/Library/Application Support/Blender/4.1/scripts/addons/blenderbim/bim/module/geometry/operator.py", line 1530, in execute
    return IfcStore.execute_ifc_operator(self, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cesarcruz/Library/Application Support/Blender/4.1/scripts/addons/blenderbim/bim/ifc.py", line 360, in execute_ifc_operator
    result = getattr(operator, "_execute")(context)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cesarcruz/Library/Application Support/Blender/4.1/scripts/addons/blenderbim/bim/module/geometry/operator.py", line 1561, in _execute
    representation = tool.Geometry.get_active_representation(obj)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cesarcruz/Library/Application Support/Blender/4.1/scripts/addons/blenderbim/tool/geometry.py", line 327, in get_active_representation
    return tool.Ifc.get().by_id(obj.data.BIMMeshProperties.ifc_definition_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cesarcruz/Library/Application Support/Blender/4.1/scripts/addons/blenderbim/libs/site/packages/ifcopenshell/file.py", line 425, in by_id
    return self[id]
           ~~~~^^^^
  File "/Users/cesarcruz/Library/Application Support/Blender/4.1/scripts/addons/blenderbim/libs/site/packages/ifcopenshell/file.py", line 410, in __getitem__
    return entity_instance(self.wrapped_data.by_id(key), self)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cesarcruz/Library/Application Support/Blender/4.1/scripts/addons/blenderbim/libs/site/packages/ifcopenshell/ifcopenshell_wrapper.py", line 3800, in by_id
    return _ifcopenshell_wrapper.file_by_id(self, id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Instance #100 not found

ifc: Unsaved
schema: IFC4
preprocessor_version: IfcOpenShell v0.7.0-c7830e9e5
originating_system: IfcOpenShell v0.7.0-c7830e9e5
Moult commented 3 weeks ago

It's a bit hard to tell exactly what is the cause here. Can you recreate this reliably? If so, do you have a file to share (dion@thinkmoult.com if private). Are you loading/saving blends (don't!) or loading/saving .ifc files?