From 9e87f0f0272b7fa0e72b939045f6e3a875153985 Mon Sep 17 00:00:00 2001 From: Vukas Pajic <83825269+vulevukusej@users.noreply.github.com> Date: Tue, 5 Jul 2022 07:34:23 +0200 Subject: [PATCH] fix for issue #2261 --- .../ifcopenshell/api/pset/edit_pset.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/pset/edit_pset.py b/src/ifcopenshell-python/ifcopenshell/api/pset/edit_pset.py index 28c307756c..71e6ada005 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/pset/edit_pset.py +++ b/src/ifcopenshell-python/ifcopenshell/api/pset/edit_pset.py @@ -106,7 +106,11 @@ class Usecase: properties.append(value) continue else: - nominal_value = value + properties.append( + self.file.create_entity( + "IfcPropertySingleValue", + **{"Name": name, "NominalValue": 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: @@ -130,12 +134,12 @@ class Usecase: 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):