fix error that stopped user from adding properties

This commit is contained in:
Vukas Pajic
2022-07-01 13:41:20 +02:00
committed by GitHub
parent 4ad4bdef3b
commit c73fedaaaf
@@ -102,9 +102,11 @@ class Usecase:
if value is None:
continue
if isinstance(value, ifcopenshell.entity_instance):
nominal_value = value
if value.is_a(True) == "IFC4.IfcPropertyEnumeratedValue":
properties.append(value)
continue
else:
nominal_value = value
#TODO-The following "elif" is temporary code, will need to refactor at some point - vulevukusej
elif isinstance(value, list):
for pset_template in self.settings["pset_template"].HasPropertyTemplates:
@@ -122,17 +124,18 @@ class Usecase:
EnumerationReference=prop_enum
)
properties.append(prop_enum_value)
continue
else:
primary_measure_type = self.get_primary_measure_type(name, new_value=value)
value = self.cast_value_to_primary_measure_type(value, primary_measure_type)
nominal_value = self.file.create_entity(primary_measure_type, value)
properties.append(
self.file.create_entity(
"IfcPropertySingleValue",
**{"Name": name, "NominalValue": nominal_value},
)
properties.append(
self.file.create_entity(
"IfcPropertySingleValue",
**{"Name": name, "NominalValue": nominal_value},
)
)
return properties
def extend_pset_with_new_properties(self, new_properties):