From 1257eb087252f6093cdacb541e507d7e7207d292 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 5 Mar 2025 15:46:37 +0500 Subject: [PATCH] append_asset - allow using same name for different ifcpresentationstyle types Since they are not used interchangeably typically. --- .../ifcopenshell/api/project/append_asset.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/project/append_asset.py b/src/ifcopenshell-python/ifcopenshell/api/project/append_asset.py index 2109bca618..279bdc8fd6 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/project/append_asset.py +++ b/src/ifcopenshell-python/ifcopenshell/api/project/append_asset.py @@ -229,7 +229,9 @@ class Usecase: return next((e for e in self.file.by_type("IfcProfileDef") if e.ProfileName == profile_name), None) elif element.is_a("IfcPresentationStyle"): name = element.Name - return next((e for e in self.file.by_type("IfcPresentationStyle") if e.Name == name), None) + if name is None: + return None + return next((e for e in self.file.by_type(element.is_a()) if e.Name == name), None) else: return None