mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Fixing collectors tests after 1f43ec8
This commit is contained in:
@@ -264,29 +264,32 @@ class TestAssign(NewFile):
|
|||||||
|
|
||||||
def test_in_decomposition_mode_drawings_are_placed_in_a_group_in_a_views_collection(self):
|
def test_in_decomposition_mode_drawings_are_placed_in_a_group_in_a_views_collection(self):
|
||||||
bpy.ops.bim.create_project()
|
bpy.ops.bim.create_project()
|
||||||
element_obj = bpy.data.objects.new("IfcAnnotation/Name", None)
|
element_obj = bpy.data.objects.new("IfcAnnotation/DRAWING", None)
|
||||||
element = tool.Ifc.get().createIfcAnnotation(ObjectType="DRAWING")
|
element = tool.Ifc.get().createIfcAnnotation(ObjectType="DRAWING")
|
||||||
tool.Ifc.link(element, element_obj)
|
tool.Ifc.link(element, element_obj)
|
||||||
|
|
||||||
group = ifcopenshell.api.run("group.add_group", tool.Ifc.get())
|
group = ifcopenshell.api.run("group.add_group", tool.Ifc.get())
|
||||||
group.ObjectType = "DRAWING"
|
group.ObjectType = "DRAWING"
|
||||||
ifcopenshell.api.run("group.assign_group", tool.Ifc.get(), products=[element], group=group)
|
ifcopenshell.api.run("group.assign_group", tool.Ifc.get(), products=[element], group=group)
|
||||||
|
|
||||||
subject.assign(element_obj)
|
subject.assign(element_obj)
|
||||||
assert element_obj.users_collection[0].name == "IfcGroup/Unnamed"
|
assert element_obj.users_collection[0].name == "IfcAnnotation/DRAWING"
|
||||||
assert bpy.data.collections.get("Views").children.get("IfcGroup/Unnamed")
|
assert bpy.data.collections.get("Views").children.get("IfcAnnotation/DRAWING")
|
||||||
assert bpy.data.collections.get("IfcProject/My Project").children.get("Views")
|
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):
|
def test_in_decomposition_mode_annotations_are_placed_in_a_group_in_a_views_collection(self):
|
||||||
bpy.ops.bim.create_project()
|
self.test_in_decomposition_mode_drawings_are_placed_in_a_group_in_a_views_collection()
|
||||||
|
ifc_file = tool.Ifc.get()
|
||||||
|
|
||||||
element_obj = bpy.data.objects.new("IfcAnnotation/Name", None)
|
element_obj = bpy.data.objects.new("IfcAnnotation/Name", None)
|
||||||
element = tool.Ifc.get().createIfcAnnotation()
|
element = ifc_file.createIfcAnnotation()
|
||||||
tool.Ifc.link(element, element_obj)
|
tool.Ifc.link(element, element_obj)
|
||||||
group = ifcopenshell.api.run("group.add_group", tool.Ifc.get())
|
|
||||||
group.ObjectType = "DRAWING"
|
group = ifc_file.by_type("IfcGroup")[0]
|
||||||
ifcopenshell.api.run("group.assign_group", tool.Ifc.get(), products=[element], group=group)
|
ifcopenshell.api.run("group.assign_group", ifc_file, products=[element], group=group)
|
||||||
|
|
||||||
subject.assign(element_obj)
|
subject.assign(element_obj)
|
||||||
assert element_obj.users_collection[0].name == "IfcGroup/Unnamed"
|
assert element_obj.users_collection[0].name == "IfcAnnotation/DRAWING"
|
||||||
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_structural_members_are_placed_in_a_members_collection(self):
|
def test_in_decomposition_mode_structural_members_are_placed_in_a_members_collection(self):
|
||||||
bpy.ops.bim.create_project()
|
bpy.ops.bim.create_project()
|
||||||
|
|||||||
Reference in New Issue
Block a user