mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-09 13:52:23 +00:00
The storey is now the default container when starting a project for convenience.
This commit is contained in:
@@ -63,6 +63,7 @@ class TestCreateProject:
|
||||
project.run_aggregate_assign_object(relating_obj="building", related_obj="storey").should_be_called()
|
||||
|
||||
project.set_context("body").should_be_called()
|
||||
project.set_active_spatial_element("storey").should_be_called()
|
||||
|
||||
subject.create_project(ifc, project, schema="IFC4", template=None)
|
||||
|
||||
@@ -103,6 +104,7 @@ class TestCreateProject:
|
||||
project.run_aggregate_assign_object(relating_obj="building", related_obj="storey").should_be_called()
|
||||
|
||||
project.set_context("body").should_be_called()
|
||||
project.set_active_spatial_element("storey").should_be_called()
|
||||
|
||||
project.append_all_types_from_template("template").should_be_called()
|
||||
|
||||
@@ -152,5 +154,6 @@ class TestCreateProject:
|
||||
project.run_aggregate_assign_object(relating_obj="building", related_obj="storey").should_be_called()
|
||||
|
||||
project.set_context("body").should_be_called()
|
||||
project.set_active_spatial_element("storey").should_be_called()
|
||||
|
||||
subject.create_project(ifc, project, schema="IFC2X3", template=None)
|
||||
|
||||
@@ -82,6 +82,18 @@ class TestRunUnitAssignSceneUnits(NewFile):
|
||||
pass
|
||||
|
||||
|
||||
class TestSetActiveSpatialElement(NewFile):
|
||||
def test_run(self):
|
||||
obj = bpy.data.objects.new("Foo", None)
|
||||
collection = bpy.data.collections.new("Foo")
|
||||
bpy.context.scene.collection.children.link(collection)
|
||||
collection.objects.link(obj)
|
||||
layer = bpy.context.view_layer.layer_collection.children["Foo"]
|
||||
assert bpy.context.view_layer.active_layer_collection != layer
|
||||
subject.set_active_spatial_element(obj)
|
||||
assert bpy.context.view_layer.active_layer_collection == layer
|
||||
|
||||
|
||||
class TestSetContext(NewFile):
|
||||
def test_run(self):
|
||||
ifc = ifcopenshell.file()
|
||||
|
||||
Reference in New Issue
Block a user