From 158a4c5e757d97349b79ab10dee5b1db8af67833 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Fri, 3 Feb 2023 13:21:23 +1100 Subject: [PATCH] Fix bug where IFC2X3 fallback styles couldn't be assigned. --- .../ifcopenshell/api/style/assign_representation_styles.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/style/assign_representation_styles.py b/src/ifcopenshell-python/ifcopenshell/api/style/assign_representation_styles.py index 9c6cacb206..d8d787ec6d 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/style/assign_representation_styles.py +++ b/src/ifcopenshell-python/ifcopenshell/api/style/assign_representation_styles.py @@ -113,6 +113,8 @@ class Usecase: style = self.settings["styles"].pop(0) name = style.Name if self.file.schema == "IFC2X3" or self.settings["should_use_presentation_style_assignment"]: - style = self.file.createIfcPresentationStyleAssignment([style]) - self.results.append(self.file.createIfcStyledItem(item, [style], name)) + style_assignment = self.file.createIfcPresentationStyleAssignment([style]) + self.results.append(self.file.createIfcStyledItem(item, [style_assignment], name)) + else: + self.results.append(self.file.createIfcStyledItem(item, [style], name)) return self.results