mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Fix #2837. Shared subelements mistakenly caused the subelement append loop to break early. The solution is to traverse one level at a time.
This commit is contained in:
@@ -116,6 +116,16 @@ class TestAppendAsset(test.bootstrap.IFC4):
|
||||
def test_append_a_type_product_with_its_styles(self):
|
||||
library = ifcopenshell.api.run("project.create_file")
|
||||
element = ifcopenshell.api.run("root.create_entity", library, ifc_class="IfcWallType")
|
||||
history = library.createIfcOwnerHistory()
|
||||
element.OwnerHistory = history
|
||||
|
||||
material = ifcopenshell.api.run("material.add_material", library, name="Material")
|
||||
rel = ifcopenshell.api.run("material.assign_material", library, product=element, material=material)
|
||||
# We share a history. This ensures that we continue to check all
|
||||
# whitelisted inverses even though one of the subelements (i.e. this
|
||||
# shared history) is already processed. See bug #2837.
|
||||
rel.OwnerHistory = history
|
||||
|
||||
item = library.createIfcBoundingBox()
|
||||
library.createIfcStyledItem(Item=item)
|
||||
mapped_rep = library.createIfcShapeRepresentation(Items=[item])
|
||||
|
||||
Reference in New Issue
Block a user