Drawing collection hierarchy is now auto fixed if shuffled around manually. See #1153.

This commit is contained in:
Dion Moult
2022-01-29 21:08:22 +11:00
parent 677a9d715c
commit 46e1a46dd2
2 changed files with 26 additions and 0 deletions
@@ -215,6 +215,18 @@ class TestAssign(NewFile):
assert axis_obj.users_collection[0].name == "UAxes"
assert bpy.data.collections.get("IfcGrid/Name").children.get("UAxes")
def test_in_decomposition_mode_drawings_are_placed_in_a_group_in_a_views_collection(self):
bpy.ops.bim.create_project()
element_obj = bpy.data.objects.new("IfcAnnotation/Name", None)
element = tool.Ifc.get().createIfcAnnotation(ObjectType="DRAWING")
tool.Ifc.link(element, element_obj)
group = ifcopenshell.api.run("group.add_group", tool.Ifc.get())
ifcopenshell.api.run("group.assign_group", tool.Ifc.get(), product=element, group=group)
subject.assign(element_obj)
assert element_obj.users_collection[0].name == "IfcGroup/Unnamed"
assert bpy.data.collections.get("Views").children.get("IfcGroup/Unnamed")
assert bpy.data.collections.get("IfcProject/My Project").children.get("Views")
class TestSync(NewFile):
def test_in_decomposition_mode_elements_can_be_in_spatial_containers(self):