Traceback
2024-11-18:11:09:15,441 ERROR   [log.py:69] Uncaught exception
Traceback (most recent call last):
  File "\bonsai\bim\module\pset_template\ui.py", line 66, in draw
    self.draw_pset_template()
  File "\bonsai\bim\module\pset_template\ui.py", line 110, in draw_pset_template
    value_name = self.props.active_prop_template.get_value_name()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "\bonsai\bim\module\pset_template\prop.py", line 175, in get_value_name
    ifc_data_type = IfcStore.get_schema().declaration_by_name(self.primary_measure_type)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "\ifcopenshell\ifcopenshell_wrapper.py", line 10119, in declaration_by_name
    return _ifcopenshell_wrapper.schema_definition_declaration_by_name(self, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Entity with name '-' not found in schema 'IFC4'
This commit is contained in:
Andrej730
2024-11-18 11:12:10 +05:00
parent 3c320960c8
commit 7d087064ab
@@ -171,7 +171,9 @@ class PropTemplate(PropertyGroup):
template_type: EnumProperty(items=get_property_template_type, name="Template Type")
enum_values: CollectionProperty(type=EnumerationValues)
def get_value_name(self):
def get_value_name(self) -> str:
if self.primary_measure_type == "-":
return "string_value"
ifc_data_type = IfcStore.get_schema().declaration_by_name(self.primary_measure_type)
data_type = ifcopenshell.util.attribute.get_primitive_type(ifc_data_type)
if data_type == "string":
@@ -182,6 +184,8 @@ class PropTemplate(PropertyGroup):
return "int_value"
elif data_type == "float":
return "float_value"
else:
assert False, "Unknown data type"
class BIMPsetTemplateProperties(PropertyGroup):