mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-16 10:34:31 +00:00
Fix for e0f4fc075
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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user