mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-09 13:52:23 +00:00
Spatial containers are now shown sorted by Z index order for convenience.
This commit is contained in:
@@ -45,7 +45,9 @@ Scenario: Override delete - with active IFC data
|
||||
Scenario: Override duplicate move - without active IFC data
|
||||
Given an empty Blender session
|
||||
And I add a cube
|
||||
And I add an empty
|
||||
And the object "Cube" is selected
|
||||
And additionally the object "Empty" is selected
|
||||
When I press "object.duplicate_move"
|
||||
Then the object "Cube" exists
|
||||
And the object "Cube.001" exists
|
||||
@@ -57,8 +59,11 @@ Scenario: Override duplicate move - with active IFC data
|
||||
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
|
||||
And I press "bim.assign_class"
|
||||
And the object "IfcWall/Cube" is selected
|
||||
And additionally the object "IfcBuildingStorey/My Storey" is selected
|
||||
When I press "object.duplicate_move"
|
||||
Then the object "IfcWall/Cube" exists
|
||||
And the object "IfcWall/Cube" is an "IfcWall"
|
||||
And the object "IfcWall/Cube.001" exists
|
||||
And the object "IfcWall/Cube.001" is an "IfcWall"
|
||||
And the object "IfcBuildingStorey/My Storey.001" exists
|
||||
And the object "IfcBuildingStorey/My Storey.001" is an "IfcBuildingStorey"
|
||||
|
||||
@@ -72,6 +72,12 @@ def i_add_a_cube():
|
||||
bpy.ops.mesh.primitive_cube_add()
|
||||
|
||||
|
||||
@given("I add an empty")
|
||||
@when("I add an empty")
|
||||
def i_add_an_empty():
|
||||
bpy.ops.object.empty_add()
|
||||
|
||||
|
||||
@given("I add a material")
|
||||
def i_add_a_material():
|
||||
bpy.context.active_object.active_material = bpy.data.materials.new("Material")
|
||||
|
||||
@@ -118,3 +118,18 @@ class TestImportContainers(NewFile):
|
||||
assert props.containers[0].has_decomposition is True
|
||||
assert props.containers[0].ifc_definition_id == tool.Ifc.get().by_type("IfcBuilding")[0].id()
|
||||
assert props.active_container_id == site.id()
|
||||
|
||||
def test_importing_sorted_by_z_placement(self):
|
||||
bpy.ops.bim.create_project()
|
||||
building = tool.Ifc.get().by_type("IfcBuilding")[0]
|
||||
storey1 = tool.Ifc.get().by_type("IfcBuildingStorey")[0]
|
||||
storey1.Name = "Higher"
|
||||
bpy.ops.bim.copy_class(obj=tool.Ifc.get_object(storey1).name)
|
||||
storey2 = tool.Ifc.get().by_type("IfcBuildingStorey")[1]
|
||||
storey2.Name = "Lower"
|
||||
storey2.ObjectPlacement.RelativePlacement.Location.Coordinates = (0., 0., -100.)
|
||||
subject.import_containers(building)
|
||||
props = bpy.context.scene.BIMSpatialProperties
|
||||
assert len(props.containers) == 2
|
||||
assert props.containers[0].name == "Lower"
|
||||
assert props.containers[1].name == "Higher"
|
||||
|
||||
Reference in New Issue
Block a user