Annotations are now auto collected correctly and simpler drawings UI. See #1153.

This commit is contained in:
Dion Moult
2022-02-04 19:21:24 +11:00
parent 6ce8a3621a
commit 6be87c035f
12 changed files with 208 additions and 81 deletions
@@ -221,6 +221,20 @@ class TestAssign(NewFile):
element = tool.Ifc.get().createIfcAnnotation(ObjectType="DRAWING")
tool.Ifc.link(element, element_obj)
group = ifcopenshell.api.run("group.add_group", tool.Ifc.get())
group.ObjectType = "DRAWING"
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")
def test_in_decomposition_mode_annotations_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()
tool.Ifc.link(element, element_obj)
group = ifcopenshell.api.run("group.add_group", tool.Ifc.get())
group.ObjectType = "DRAWING"
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"