| 1 |
@type |
| 2 |
Feature: Type |
| 3 |
|
| 4 |
Scenario: Add type - adding via manual class assignment |
| 5 |
Given an empty IFC project |
| 6 |
And I add a cube |
| 7 |
And the object "Cube" is selected |
| 8 |
And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType" |
| 9 |
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType" |
| 10 |
When I press "bim.assign_class" |
| 11 |
Then nothing happens |
| 12 |
|
| 13 |
Scenario: Add type - add from empty template |
| 14 |
Given an empty IFC project |
| 15 |
And I press "bim.launch_type_manager" |
| 16 |
And I set "scene.BIMModelProperties.type_class" to "IfcWallType" |
| 17 |
And I set "scene.BIMModelProperties.type_predefined_type" to "SOLIDWALL" |
| 18 |
And I set "scene.BIMModelProperties.type_template" to "EMPTY" |
| 19 |
When I press "bim.add_type" |
| 20 |
Then the object "IfcWallType/TYPEX" is an "IfcWallType" |
| 21 |
And the object "IfcWallType/TYPEX" has no data |
| 22 |
|
| 23 |
Scenario: Enable editing type |
| 24 |
Given an empty IFC project |
| 25 |
And I add a cube |
| 26 |
And the object "Cube" is selected |
| 27 |
And I set "scene.BIMRootProperties.ifc_product" to "IfcElement" |
| 28 |
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall" |
| 29 |
And I press "bim.assign_class" |
| 30 |
When I press "bim.enable_editing_type" |
| 31 |
Then nothing happens |
| 32 |
|
| 33 |
Scenario: Disable editing type |
| 34 |
Given an empty IFC project |
| 35 |
And I add a cube |
| 36 |
And the object "Cube" is selected |
| 37 |
And I set "scene.BIMRootProperties.ifc_product" to "IfcElement" |
| 38 |
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall" |
| 39 |
And I press "bim.assign_class" |
| 40 |
And I press "bim.enable_editing_type" |
| 41 |
When I press "bim.disable_editing_type" |
| 42 |
Then nothing happens |
| 43 |
|
| 44 |
Scenario: Assign type - assign to an empty type |
| 45 |
Given an empty IFC project |
| 46 |
And I add a cube |
| 47 |
And the object "Cube" is selected |
| 48 |
And I set "scene.BIMRootProperties.ifc_product" to "IfcElement" |
| 49 |
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall" |
| 50 |
And I press "bim.assign_class" |
| 51 |
And I add an empty |
| 52 |
And the object "Empty" is selected |
| 53 |
And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType" |
| 54 |
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType" |
| 55 |
And I press "bim.assign_class" |
| 56 |
When the variable "type" is "{ifc}.by_type('IfcWallType')[0].id()" |
| 57 |
And I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')" |
| 58 |
Then the object "IfcWall/Cube" has a "Tessellation" representation of "Model/Body/MODEL_VIEW" |
| 59 |
|
| 60 |
Scenario: Assign type - assign to a type with representation maps |
| 61 |
Given an empty IFC project |
| 62 |
And I add a cube |
| 63 |
And the object "Cube" is selected |
| 64 |
And I set "scene.BIMRootProperties.ifc_product" to "IfcElement" |
| 65 |
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall" |
| 66 |
And I press "bim.assign_class" |
| 67 |
And I add a cube |
| 68 |
And the object "Cube" is selected |
| 69 |
And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType" |
| 70 |
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType" |
| 71 |
And I press "bim.assign_class" |
| 72 |
When the variable "type" is "{ifc}.by_type('IfcWallType')[0].id()" |
| 73 |
And I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')" |
| 74 |
Then the object "IfcWall/Cube" has a "MappedRepresentation" representation of "Model/Body/MODEL_VIEW" |
| 75 |
|
| 76 |
Scenario: Assign type - assign to a type with a material layer set, which automatically recreates the shape |
| 77 |
Given an empty IFC project |
| 78 |
And I add a cube |
| 79 |
And the object "Cube" is selected |
| 80 |
And I set "scene.BIMRootProperties.ifc_product" to "IfcElement" |
| 81 |
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall" |
| 82 |
And I press "bim.assign_class" |
| 83 |
And I add an empty |
| 84 |
And the object "Empty" is selected |
| 85 |
And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType" |
| 86 |
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType" |
| 87 |
And I press "bim.assign_class" |
| 88 |
And I press "bim.add_material()" |
| 89 |
And I set "active_object.BIMObjectMaterialProperties.material_type" to "IfcMaterialLayerSet" |
| 90 |
And I press "bim.assign_material" |
| 91 |
When the variable "type" is "{ifc}.by_type('IfcWallType')[0].id()" |
| 92 |
And I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')" |
| 93 |
Then the object "IfcWall/Cube" has a "SweptSolid" representation of "Model/Body/MODEL_VIEW" |
| 94 |
And the object "IfcWall/Cube" has a "100" thick layered material containing the material "Default" |
| 95 |
And the object "IfcWall/Cube" dimensions are "2,.1,3" |
| 96 |
|
| 97 |
Scenario: Assign type - assign to a different type with a material layer set |
| 98 |
Given an empty IFC project |
| 99 |
And I add a cube |
| 100 |
And the object "Cube" is selected |
| 101 |
And I set "scene.BIMRootProperties.ifc_product" to "IfcElement" |
| 102 |
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall" |
| 103 |
And I press "bim.assign_class" |
| 104 |
And I add an empty |
| 105 |
And the object "Empty" is selected |
| 106 |
And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType" |
| 107 |
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType" |
| 108 |
And I press "bim.assign_class" |
| 109 |
And the variable "type" is "{ifc}.by_type('IfcWallType')[-1].id()" |
| 110 |
And I press "bim.add_material()" |
| 111 |
And I set "active_object.BIMObjectMaterialProperties.material_type" to "IfcMaterialLayerSet" |
| 112 |
And I press "bim.assign_material" |
| 113 |
And I add an empty |
| 114 |
And the object "Empty" is selected |
| 115 |
And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType" |
| 116 |
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType" |
| 117 |
And I press "bim.assign_class" |
| 118 |
And I set "active_object.BIMObjectMaterialProperties.material_type" to "IfcMaterialLayerSet" |
| 119 |
And I press "bim.assign_material" |
| 120 |
And the variable "type2" is "[w for w in {ifc}.by_type('IfcWallType') if w.id() != {type}][0].id()" |
| 121 |
And the variable "layer_set" is "ifcopenshell.util.element.get_material({ifc}.by_id({type2})).id()" |
| 122 |
And the variable "layer" is "{ifc}.by_id({layer_set}).MaterialLayers[0].id()" |
| 123 |
And I press "bim.enable_editing_material_set_item(material_set_item={layer})" |
| 124 |
And I set "active_object.BIMObjectMaterialProperties.material_set_item_attributes[0].float_value" to "200" |
| 125 |
And I press "bim.edit_material_set_item(material_set_item={layer})" |
| 126 |
And I press "bim.edit_assigned_material(material_set={layer_set})" |
| 127 |
When I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')" |
| 128 |
Then the object "IfcWall/Cube" has a "SweptSolid" representation of "Model/Body/MODEL_VIEW" |
| 129 |
And the object "IfcWall/Cube" has a "100" thick layered material containing the material "Default" |
| 130 |
And the object "IfcWall/Cube" dimensions are "2,.1,3" |
| 131 |
When I press "bim.assign_type(relating_type={type2}, related_object='IfcWall/Cube')" |
| 132 |
Then the object "IfcWall/Cube" has a "200" thick layered material containing the material "Default" |
| 133 |
And the object "IfcWall/Cube" dimensions are "2,.2,3" |
| 134 |
|
| 135 |
Scenario: Assign type - assign to a type with a material profile set |
| 136 |
Given an empty IFC project |
| 137 |
And I add a cube |
| 138 |
And the object "Cube" is selected |
| 139 |
And I set "scene.BIMRootProperties.ifc_product" to "IfcElement" |
| 140 |
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall" |
| 141 |
And I press "bim.assign_class" |
| 142 |
And I add an empty |
| 143 |
And the object "Empty" is selected |
| 144 |
And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType" |
| 145 |
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType" |
| 146 |
And I press "bim.assign_class" |
| 147 |
And I press "bim.add_material()" |
| 148 |
And I set "active_object.BIMObjectMaterialProperties.material_type" to "IfcMaterialProfileSet" |
| 149 |
And I press "bim.assign_material" |
| 150 |
And I press "bim.enable_editing_assigned_material" |
| 151 |
And I press "bim.add_profile_def" |
| 152 |
And the variable "profile_set" is "{ifc}.by_type("IfcMaterialProfileSet")[0].id()" |
| 153 |
And I press "bim.add_profile(profile_set={profile_set})" |
| 154 |
And I press "bim.edit_assigned_material(material_set={profile_set})" |
| 155 |
When the variable "type" is "{ifc}.by_type('IfcWallType')[0].id()" |
| 156 |
And I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')" |
| 157 |
Then the object "IfcWall/Cube" has a "SweptSolid" representation of "Model/Body/MODEL_VIEW" |
| 158 |
|
| 159 |
Scenario: Select type objects |
| 160 |
Given an empty IFC project |
| 161 |
And I add a cube |
| 162 |
And the object "Cube" is selected |
| 163 |
And I set "scene.BIMRootProperties.ifc_product" to "IfcElement" |
| 164 |
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall" |
| 165 |
And I press "bim.assign_class" |
| 166 |
And I add an empty |
| 167 |
And the object "Empty" is selected |
| 168 |
And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType" |
| 169 |
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType" |
| 170 |
And I press "bim.assign_class" |
| 171 |
And the variable "type" is "{ifc}.by_type('IfcWallType')[0].id()" |
| 172 |
And I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')" |
| 173 |
When the object "IfcWallType/Empty" is selected |
| 174 |
And I press "bim.select_type_objects" |
| 175 |
Then the object "IfcWall/Cube" is selected |
| 176 |
|
| 177 |
Scenario: Select similar type |
| 178 |
Given an empty IFC project |
| 179 |
And I add a cube |
| 180 |
And the object "Cube" is selected |
| 181 |
And I set "scene.BIMRootProperties.ifc_product" to "IfcElement" |
| 182 |
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall" |
| 183 |
And I press "bim.assign_class" |
| 184 |
And I add a cube |
| 185 |
And the object "Cube" is selected |
| 186 |
And I set "scene.BIMRootProperties.ifc_product" to "IfcElement" |
| 187 |
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall" |
| 188 |
And I press "bim.assign_class" |
| 189 |
And I add an empty |
| 190 |
And the object "Empty" is selected |
| 191 |
And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType" |
| 192 |
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType" |
| 193 |
And I press "bim.assign_class" |
| 194 |
And the variable "type" is "{ifc}.by_type('IfcWallType')[0].id()" |
| 195 |
And I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')" |
| 196 |
And I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube.001')" |
| 197 |
When the object "IfcWall/Cube" is selected |
| 198 |
And I press "bim.select_similar_type" |
| 199 |
Then the object "IfcWall/Cube" is selected |
| 200 |
And the object "IfcWall/Cube.001" is selected |
| 201 |
|
| 202 |
Scenario: Purge unused types |
| 203 |
Given an empty IFC project |
| 204 |
And I press "bim.launch_type_manager" |
| 205 |
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType" |
| 206 |
And I set "scene.BIMRootProperties.ifc_predefined_type" to "SOLIDWALL" |
| 207 |
And I set "scene.BIMRootProperties.representation_template" to "EMPTY" |
| 208 |
When I press "bim.add_element" |
| 209 |
Then the object "IfcWallType/Unnamed" is an "IfcWallType" |
| 210 |
And the object "IfcWallType/Unnamed" has no data |
| 211 |
When I press "bim.purge_unused_objects(object_type='TYPE')" |
| 212 |
Then the object "IfcWallType/Unnamed" does not exist |