Skip to content

Bonsai: Error when creating manual classification entry #7506

@semhustej

Description

@semhustej

Bug Description

Steps to reproduce:

  • open new file
  • create a wall
  • select the wall and go to Classification References
  • choose Manual Entry from the drop down
  • click Add Reference button
  • type some text into Identification and Name fields
  • click Save
  • error shows up and the classification reference is not saved

Attachments

No response

Debug and Error Output

os: Windows
os_version: 10.0.19045
python_version: 3.11.11
architecture: ('64bit', 'WindowsPE')
machine: AMD64
processor: Intel64 Family 6 Model 60 Stepping 3, GenuineIntel
blender_version: 4.5.4 LTS
bonsai_version: 0.8.4
bonsai_commit_hash: None
bonsai_commit_date: None
last_actions: 
# ifcopenshell.api: owner.create_owner_history
>>> {}
# ifcopenshell.api: material.assign_material
>>> {"products": [{"cast_type": "entity_instance", "value": 74, "Name": "Wall"}], "type": "IfcMaterialLayerSetUsage"}
# ifcopenshell.api: material.unassign_material
>>> {"products": [{"cast_type": "entity_instance", "value": 74, "Name": "Wall"}]}
# ifcopenshell.api: owner.create_owner_history
>>> {}
# ifcopenshell.api: geometry.add_axis_representation
>>> {"context": {"cast_type": "entity_instance", "value": 27, "Name": null}, "axis": "[(0.0, 0.0), (12.500000000000036, 0.0)]"}
# ifcopenshell.api: geometry.assign_representation
>>> {"product": {"cast_type": "entity_instance", "value": 74, "Name": "Wall"}, "representation": {"cast_type": "entity_instance", "value": 81, "Name": null}}
# ifcopenshell.api: owner.update_owner_history
>>> {"element": {"cast_type": "entity_instance", "value": 74, "Name": "Wall"}}
# ifcopenshell.api: geometry.edit_object_placement
>>> {"product": {"cast_type": "entity_instance", "value": 74, "Name": "Wall"}, "matrix": {"cast_type": "ndarray", "value": [[7.549790126404332e-08, -1.0, 0.0, -4.596266746520996], [1.0, 7.549790126404332e-08, 0.0, -3.8567256927490234], [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": 74, "Name": "Wall"}}
# ifcopenshell.api: geometry.add_wall_representation
>>> {"context": {"cast_type": "entity_instance", "value": 15, "Name": null}, "thickness": "0.1", "direction_sense": "POSITIVE", "offset": "0.0", "length": "12.500000000000036", "height": "3.0", "x_angle": "0"}
# ifcopenshell.api: geometry.assign_representation
>>> {"product": {"cast_type": "entity_instance", "value": 74, "Name": "Wall"}, "representation": {"cast_type": "entity_instance", "value": 97, "Name": null}}
# ifcopenshell.api: owner.update_owner_history
>>> {"element": {"cast_type": "entity_instance", "value": 74, "Name": "Wall"}}
# ifcopenshell.api: pset.add_pset
>>> {"product": {"cast_type": "entity_instance", "value": 74, "Name": "Wall"}, "name": "EPset_Parametric"}
# ifcopenshell.api: owner.create_owner_history
>>> {}
# ifcopenshell.api: pset.assign_pset
>>> {}
# ifcopenshell.api: owner.create_owner_history
>>> {}
# ifcopenshell.api: pset.edit_pset
>>> {"pset": {"cast_type": "entity_instance", "value": 98, "Name": "EPset_Parametric"}, "properties": "{'Engine': 'Bonsai.DumbLayer2'}"}
# ifcopenshell.api: material.edit_layer_usage
>>> {"usage": {"cast_type": "entity_instance", "value": 77, "Name": null}, "attributes": "{'OffsetFromReferenceLine': 0.0, 'DirectionSense': 'POSITIVE'}"}
# ifcopenshell.api: geometry.regenerate_wall_representation
>>> {}
# operator: BIM_OT_add_manual_classification_reference
last_error: Traceback (most recent call last):
  File "C:\Users\semhu\AppData\Roaming\Blender Foundation\Blender\4.5\extensions\.local\lib\python3.11\site-packages\bonsai\bim\ifc.py", line 526, in execute_ifc_operator
    result = getattr(operator, "_execute")(context)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\semhu\AppData\Roaming\Blender Foundation\Blender\4.5\extensions\.local\lib\python3.11\site-packages\bonsai\bim\module\classification\operator.py", line 94, in _execute
    classification = tool.Ifc.get().by_id(int(props.classifications))
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''

ifc: Unsaved
schema: IFC4
preprocessor_version: IfcOpenShell 0.8.4
originating_system: IfcOpenShell 0.8.4

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