Fix bug where copying objects with profiles should only share profiles if the profile is named.

This commit is contained in:
Dion Moult
2023-01-28 21:51:00 +11:00
parent 1a05fae826
commit 6a2307308c
5 changed files with 32 additions and 9 deletions
@@ -38,8 +38,8 @@ class TestAddContext(test.bootstrap.IFC4):
assert context.ContextType == "Plan"
assert context.is_a() == "IfcGeometricRepresentationContext"
assert context.WorldCoordinateSystem.is_a() == "IfcAxis2Placement2D"
assert context.WorldCoordinateSystem.Location.Coordinates == (0, 0, 0)
assert context.WorldCoordinateSystem.RefDirection.DirectionRatios == (1, 0, 0)
assert context.WorldCoordinateSystem.Location.Coordinates == (0, 0)
assert context.WorldCoordinateSystem.RefDirection.DirectionRatios == (1, 0)
assert context.CoordinateSpaceDimension == 2
def test_defaulting_to_3d_with_an_unknown_context_type(self):
@@ -700,3 +700,10 @@ class TestCopyDeepIFC4(test.bootstrap.IFC4):
rel.RelatedObjects = [element]
rel2 = subject.copy_deep(self.file, rel, exclude=["IfcWall"])
assert rel.RelatedObjects == rel2.RelatedObjects
def test_copying_an_element_recursively_with_aggregates_with_an_exclude_callback(self):
element = self.file.createIfcWall(Name="name")
rel = self.file.createIfcRelAggregates()
rel.RelatedObjects = [element]
rel2 = subject.copy_deep(self.file, rel, exclude_callback=lambda x: x.is_a("IfcWall"))
assert rel.RelatedObjects == rel2.RelatedObjects