mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 06:58:56 +00:00
Fix regression where changing assigned types didn't update the materials.
This commit is contained in:
@@ -141,6 +141,7 @@ Scenario: Assign material - material layer set
|
||||
When I set "active_object.BIMObjectMaterialProperties.material_type" to "IfcMaterialLayerSet"
|
||||
And I press "bim.assign_material"
|
||||
Then the object "IfcWallType/Empty" does not have the material "Default"
|
||||
And the object "IfcWallType/Empty" has a "0.1" thick layered material containing the material "Default"
|
||||
|
||||
Scenario: Unassign material - material layer set
|
||||
Given an empty IFC project
|
||||
@@ -155,6 +156,27 @@ Scenario: Unassign material - material layer set
|
||||
When I press "bim.unassign_material"
|
||||
Then nothing happens
|
||||
|
||||
Scenario: Unassign material - material layer set usages will not be removed
|
||||
Given an empty IFC project
|
||||
And I add a cube
|
||||
And the object "Cube" is selected
|
||||
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
|
||||
And I press "bim.assign_class"
|
||||
And I add an empty
|
||||
And the object "Empty" is selected
|
||||
And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType"
|
||||
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType"
|
||||
And I press "bim.assign_class"
|
||||
And I press "bim.add_material(obj='')"
|
||||
And I set "active_object.BIMObjectMaterialProperties.material_type" to "IfcMaterialLayerSet"
|
||||
And I press "bim.assign_material"
|
||||
And the object "IfcWall/Cube" is selected
|
||||
When the variable "type" is "{ifc}.by_type('IfcWallType')[0].id()"
|
||||
And I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')"
|
||||
Then the object "IfcWall/Cube" has a "0.1" thick layered material containing the material "Default"
|
||||
When I press "bim.unassign_material"
|
||||
Then the object "IfcWall/Cube" has a "0.1" thick layered material containing the material "Default"
|
||||
|
||||
Scenario: Enable editing assigned material - material layer set
|
||||
Given an empty IFC project
|
||||
And I add a cube
|
||||
|
||||
@@ -1,6 +1,25 @@
|
||||
@type
|
||||
Feature: Type
|
||||
|
||||
Scenario: Enable editing type
|
||||
Given an empty IFC project
|
||||
And I add a cube
|
||||
And the object "Cube" is selected
|
||||
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
|
||||
And I press "bim.assign_class"
|
||||
When I press "bim.enable_editing_type"
|
||||
Then nothing happens
|
||||
|
||||
Scenario: Disable editing type
|
||||
Given an empty IFC project
|
||||
And I add a cube
|
||||
And the object "Cube" is selected
|
||||
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
|
||||
And I press "bim.assign_class"
|
||||
And I press "bim.enable_editing_type"
|
||||
When I press "bim.disable_editing_type"
|
||||
Then nothing happens
|
||||
|
||||
Scenario: Assign type - assign to an empty type
|
||||
Given an empty IFC project
|
||||
And I add a cube
|
||||
@@ -31,7 +50,7 @@ Scenario: Assign type - assign to a type with representation maps
|
||||
And I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')"
|
||||
Then the object "IfcWall/Cube" has a "MappedRepresentation" representation of "Model/Body/MODEL_VIEW"
|
||||
|
||||
Scenario: Assign type - assign to a type with a material layer set
|
||||
Scenario: Assign type - assign to a type with a material layer set, which automatically recreates the shape
|
||||
Given an empty IFC project
|
||||
And I add a cube
|
||||
And the object "Cube" is selected
|
||||
@@ -45,17 +64,50 @@ Scenario: Assign type - assign to a type with a material layer set
|
||||
And I press "bim.add_material(obj='')"
|
||||
And I set "active_object.BIMObjectMaterialProperties.material_type" to "IfcMaterialLayerSet"
|
||||
And I press "bim.assign_material"
|
||||
And I press "bim.enable_editing_assigned_material"
|
||||
And the variable "layer_set" is "{ifc}.by_type("IfcMaterialLayerSet")[0].id()"
|
||||
And I press "bim.add_layer(layer_set={layer_set})"
|
||||
And the variable "layer" is "{ifc}.by_type("IfcMaterialLayer")[0].id()"
|
||||
And I press "bim.enable_editing_material_set_item(material_set_item={layer})"
|
||||
And I set "active_object.BIMObjectMaterialProperties.material_set_item_attributes[0].float_value" to "0.1"
|
||||
And I press "bim.edit_material_set_item(material_set_item={layer})"
|
||||
And I press "bim.edit_assigned_material(material_set={layer_set})"
|
||||
When the variable "type" is "{ifc}.by_type('IfcWallType')[0].id()"
|
||||
And I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')"
|
||||
Then the object "IfcWall/Cube" has a "SweptSolid" representation of "Model/Body/MODEL_VIEW"
|
||||
And the object "IfcWall/Cube" has the material "Default"
|
||||
And the object "IfcWall/Cube" has a "0.1" thick layered material containing the material "Default"
|
||||
And the object "IfcWall/Cube" dimensions are "2,.1,3"
|
||||
|
||||
Scenario: Assign type - assign to a dfferent type with a material layer set
|
||||
Given an empty IFC project
|
||||
And I add a cube
|
||||
And the object "Cube" is selected
|
||||
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
|
||||
And I press "bim.assign_class"
|
||||
And I add an empty
|
||||
And the object "Empty" is selected
|
||||
And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType"
|
||||
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType"
|
||||
And I press "bim.assign_class"
|
||||
And the variable "type" is "{ifc}.by_type('IfcWallType')[-1].id()"
|
||||
And I press "bim.add_material(obj='')"
|
||||
And I set "active_object.BIMObjectMaterialProperties.material_type" to "IfcMaterialLayerSet"
|
||||
And I press "bim.assign_material"
|
||||
And I add an empty
|
||||
And the object "Empty" is selected
|
||||
And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType"
|
||||
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType"
|
||||
And I press "bim.assign_class"
|
||||
And I set "active_object.BIMObjectMaterialProperties.material_type" to "IfcMaterialLayerSet"
|
||||
And I press "bim.assign_material"
|
||||
And the variable "type2" is "[w for w in {ifc}.by_type('IfcWallType') if w.id() != {type}][0].id()"
|
||||
And the variable "layer_set" is "ifcopenshell.util.element.get_material({ifc}.by_id({type2})).id()"
|
||||
And the variable "layer" is "{ifc}.by_id({layer_set}).MaterialLayers[0].id()"
|
||||
And I press "bim.enable_editing_material_set_item(material_set_item={layer})"
|
||||
And I set "active_object.BIMObjectMaterialProperties.material_set_item_attributes[0].float_value" to "0.2"
|
||||
And I press "bim.edit_material_set_item(material_set_item={layer})"
|
||||
And I press "bim.edit_assigned_material(material_set={layer_set})"
|
||||
When I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')"
|
||||
Then the object "IfcWall/Cube" has a "SweptSolid" representation of "Model/Body/MODEL_VIEW"
|
||||
And the object "IfcWall/Cube" has the material "Default"
|
||||
And the object "IfcWall/Cube" has a "0.1" thick layered material containing the material "Default"
|
||||
And the object "IfcWall/Cube" dimensions are "2,.1,3"
|
||||
When I press "bim.assign_type(relating_type={type2}, related_object='IfcWall/Cube')"
|
||||
Then the object "IfcWall/Cube" has a "0.2" thick layered material containing the material "Default"
|
||||
And the object "IfcWall/Cube" dimensions are "2,.2,3"
|
||||
|
||||
Scenario: Assign type - assign to a type with a material profile set
|
||||
Given an empty IFC project
|
||||
|
||||
Reference in New Issue
Block a user