diff --git a/src/ifcopenshell-python/ifcopenshell/api/project/append_asset.py b/src/ifcopenshell-python/ifcopenshell/api/project/append_asset.py index 67cd0a33c2..22eb022e99 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/project/append_asset.py +++ b/src/ifcopenshell-python/ifcopenshell/api/project/append_asset.py @@ -479,7 +479,9 @@ class Usecase: # IfcRelAssociatesClassification to openings! We only ever want # to consider IfcFeatureElements in IfcRelVoidsElements and # IfcRelProjectsElements. - if element.is_a() in ("IfcRelVoidsElement", "IfcRelProjectsElement") or not self.is_another_asset(attribute): + if element.is_a() in ("IfcRelVoidsElement", "IfcRelProjectsElement") or not self.is_another_asset( + attribute + ): new_attribute = self.add_element(attribute) elif isinstance(attribute, tuple) and attribute and isinstance(attribute[0], ifcopenshell.entity_instance): new_attribute = [] diff --git a/src/ifcopenshell-python/test/api/project/test_append_asset.py b/src/ifcopenshell-python/test/api/project/test_append_asset.py index ced9c8b251..399ee1fd04 100644 --- a/src/ifcopenshell-python/test/api/project/test_append_asset.py +++ b/src/ifcopenshell-python/test/api/project/test_append_asset.py @@ -415,10 +415,15 @@ class TestAppendAssetIFC2X3(test.bootstrap.IFC2X3): element = ifcopenshell.api.root.create_entity(library, ifc_class="IfcWall") opening = ifcopenshell.api.root.create_entity(library, ifc_class="IfcOpeningElement") classification = ifcopenshell.api.classification.add_classification( - library, classification="MyCustomClassification") - ifcopenshell.api.classification.add_reference(library, - products=[element, opening], classification=classification, - identification="W_01", name="Interior Walls") + library, classification="MyCustomClassification" + ) + ifcopenshell.api.classification.add_reference( + library, + products=[element, opening], + classification=classification, + identification="W_01", + name="Interior Walls", + ) ifcopenshell.api.project.append_asset(self.file, library=library, element=element) wall = self.file.by_type("IfcWall")[0] assert wall