Debian Codegraph @

src/bonsai/test/bim/feature/geometry.feature

raw
1 @geometry
2 Feature: Geometry
3
4 Scenario: Edit object placement
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 "IfcElement"
9 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
10 And I press "bim.assign_class"
11 And the object "IfcWall/Cube" is selected
12 When I press "bim.edit_object_placement"
13 Then nothing happens
14
15 Scenario: Add representation
16 Given an empty IFC project
17 And I add a cube
18 And the object "Cube" is selected
19 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
20 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
21 And I press "bim.assign_class"
22 And the object "IfcWall/Cube" is selected
23 Then the object "IfcWall/Cube" data is a "Tessellation" representation of "Model/Body/MODEL_VIEW"
24 When the variable "context" is "[c for c in {ifc}.by_type('IfcGeometricRepresentationSubContext') if c.ContextType == 'Plan' and c.ContextIdentifier == 'Body' and c.TargetView == 'PLAN_VIEW'][0].id()"
25 And I set "active_object.BIMGeometryProperties.contexts" to "{context}"
26 And I press "bim.add_representation"
27 Then the object "IfcWall/Cube" data is a "Annotation2D" representation of "Plan/Body/PLAN_VIEW"
28
29 Scenario: Add representation - add a new representation to a typed instance
30 Given an empty IFC project
31 And I add a cube
32 And the object "Cube" is selected
33 And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType"
34 And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType"
35 And I press "bim.assign_class"
36 And I press "bim.add_occurrence"
37 And I press "bim.add_occurrence"
38 Then the object "IfcWall/Wall" data is a "Tessellation" representation of "Model/Body/MODEL_VIEW"
39 And the object "IfcWall/Wall.001" data is a "Tessellation" representation of "Model/Body/MODEL_VIEW"
40 When the object "IfcWall/Wall" is selected
41 And the variable "context" is "[c for c in {ifc}.by_type('IfcGeometricRepresentationSubContext') if c.ContextType == 'Plan' and c.ContextIdentifier == 'Body' and c.TargetView == 'PLAN_VIEW'][0].id()"
42 And I set "active_object.BIMGeometryProperties.contexts" to "{context}"
43 And I press "bim.add_representation"
44 Then the object "IfcWall/Wall" data is a "Annotation2D" representation of "Plan/Body/PLAN_VIEW"
45 And the object "IfcWall/Wall.001" data is a "Annotation2D" representation of "Plan/Body/PLAN_VIEW"
46
47 Scenario: Add representation - add a representation with a scale factor applied
48 Given an empty IFC project
49 And I add a cube
50 And the object "Cube" is selected
51 When the object "Cube" is scaled to "2"
52 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
53 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
54 And I press "bim.assign_class"
55 Then the object "IfcWall/Cube" has no scale
56 And the object "IfcWall/Cube" dimensions are "4,4,4"
57
58 Scenario: Add representation - add a representation with a scale factor still applied regardless of multiple users
59 Given an empty IFC project
60 And I add a cube
61 And I press "object.duplicate_move_linked"
62 And the object "Cube" is selected
63 When the object "Cube" is scaled to "2"
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 Then the object "IfcWall/Cube" has no scale
68 And the object "IfcWall/Cube" dimensions are "4,4,4"
69
70 Scenario: Switch representation
71 Given an empty IFC project
72 And I add a cube
73 And the object "Cube" is selected
74 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
75 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
76 And I press "bim.assign_class"
77 When the variable "representation" is "{ifc}.by_type('IfcShapeRepresentation')[0].id()"
78 And I press "bim.switch_representation(obj='IfcWall/Cube', ifc_definition_id={representation})"
79 Then nothing happens
80
81 Scenario: Switch representation - existing Blender modifiers must be purged
82 Given an empty IFC project
83 And I add a cube
84 And the object "Cube" is selected
85 And I add an array modifier
86 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
87 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
88 And I press "bim.assign_class"
89 When the variable "representation" is "{ifc}.by_type('IfcShapeRepresentation')[0].id()"
90 And I press "bim.switch_representation(obj='IfcWall/Cube', ifc_definition_id={representation})"
91 Then the object "IfcWall/Cube" has no modifiers
92
93 Scenario: Remove representation - remove an active representation
94 Given an empty IFC project
95 And I add a cube
96 And the object "Cube" is selected
97 And I add an array modifier
98 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
99 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
100 And I press "bim.assign_class"
101 When the variable "representation_body" is "{ifc}.by_type('IfcShapeRepresentation')[0].id()"
102 And I press "bim.remove_representation(representation_id={representation_body})"
103 Then the object "IfcWall/Cube" has no data
104
105 Scenario: Remove representation - remove an unloaded representation
106 Given an empty IFC project
107 And I add a cube
108 And the object "Cube" is selected
109 And I add an array modifier
110 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
111 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
112 And I press "bim.assign_class"
113 When the variable "context" is "[c for c in {ifc}.by_type('IfcGeometricRepresentationSubContext') if c.ContextType == 'Plan' and c.ContextIdentifier == 'Body' and c.TargetView == 'PLAN_VIEW'][0].id()"
114 And I set "active_object.BIMGeometryProperties.contexts" to "{context}"
115 And I press "bim.add_representation"
116 When the variable "representation" is "{ifc}.by_type('IfcShapeRepresentation')[1].id()"
117 And I press "bim.remove_representation(representation_id={representation})"
118 Then the object "IfcWall/Cube" has data which is an IFC representation
119
120 Scenario: Remove representation - remove an instanced representation from an active type object
121 Given an empty IFC project
122 And I add a cube
123 And the object "Cube" is selected
124 And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType"
125 And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType"
126 And I press "bim.assign_class"
127 And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType"
128 And the variable "cube" is "{ifc}.by_type('IfcWallType')[0].id()"
129 And I set "scene.BIMModelProperties.relating_type_id" to "{cube}"
130 And I press "bim.add_occurrence"
131 And I press "bim.add_occurrence"
132 And the object "IfcWallType/Cube" is selected
133 When the variable "representation_body" is "{ifc}.by_type('IfcWallType')[0].RepresentationMaps[0].MappedRepresentation.id()"
134 And I press "bim.remove_representation(representation_id={representation_body})"
135 Then the object "IfcWallType/Cube" has no data
136 Then the object "IfcWall/Wall" has no data
137 Then the object "IfcWall/Wall.001" has no data
138
139 Scenario: Remove representation - remove an instanced representation from an active instance object
140 Given an empty IFC project
141 And I add a cube
142 And the object "Cube" is selected
143 And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType"
144 And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType"
145 And I press "bim.assign_class"
146 And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType"
147 And the variable "cube" is "{ifc}.by_type('IfcWallType')[0].id()"
148 And I set "scene.BIMModelProperties.relating_type_id" to "{cube}"
149 And I press "bim.add_occurrence"
150 And I press "bim.add_occurrence"
151 And the object "IfcWall/Wall" is selected
152 When the variable "representation_body" is "{ifc}.by_type('IfcWall')[0].Representation.Representations[0].id()"
153 And I press "bim.remove_representation(representation_id={representation_body})"
154 Then the object "IfcWallType/Cube" has no data
155 Then the object "IfcWall/Wall" has no data
156 Then the object "IfcWall/Wall.001" has no data
157
158 Scenario: Update representation - updating a tessellation
159 Given an empty IFC project
160 And I add a cube
161 And the object "Cube" is selected
162 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
163 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
164 And I press "bim.assign_class"
165 And I press "bim.update_representation(obj='IfcWall/Cube')"
166 Then the object "IfcWall/Cube" has a "Tessellation" representation of "Model/Body/MODEL_VIEW"
167
168 Scenario: Update representation - updating a layered extrusion
169 Given an empty IFC project
170 And I add a cube
171 And the object "Cube" is selected
172 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
173 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
174 And I press "bim.assign_class"
175 And I add an empty
176 And the object "Empty" is selected
177 And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType"
178 And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType"
179 And I press "bim.assign_class"
180 And I press "bim.add_material()"
181 And I set "active_object.BIMObjectMaterialProperties.material_type" to "IfcMaterialLayerSet"
182 And I press "bim.assign_material"
183 And I press "bim.enable_editing_assigned_material"
184 And the variable "layer_set" is "{ifc}.by_type("IfcMaterialLayerSet")[0].id()"
185 And I press "bim.add_layer(layer_set={layer_set})"
186 And the variable "layer" is "{ifc}.by_type("IfcMaterialLayer")[0].id()"
187 And I press "bim.enable_editing_material_set_item(material_set_item={layer})"
188 And I set "active_object.BIMObjectMaterialProperties.material_set_item_attributes[0].float_value" to "0.1"
189 And I press "bim.edit_material_set_item(material_set_item={layer})"
190 And I press "bim.edit_assigned_material(material_set={layer_set})"
191 And the variable "type" is "{ifc}.by_type('IfcWallType')[0].id()"
192 When I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')"
193 Then the object "IfcWall/Cube" has a "SweptSolid" representation of "Model/Body/MODEL_VIEW"
194
195 Scenario: Update representation - updating a profiled extrusion
196 Given an empty IFC project
197 And I add a cube
198 And the object "Cube" is selected
199 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
200 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
201 And I press "bim.assign_class"
202 And I add an empty
203 And the object "Empty" is selected
204 And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType"
205 And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType"
206 And I press "bim.assign_class"
207 And I press "bim.add_material()"
208 And I set "active_object.BIMObjectMaterialProperties.material_type" to "IfcMaterialProfileSet"
209 And I press "bim.assign_material"
210 And I press "bim.enable_editing_assigned_material"
211 And I press "bim.add_profile_def"
212 And the variable "profile_set" is "{ifc}.by_type("IfcMaterialProfileSet")[0].id()"
213 And I press "bim.add_profile(profile_set={profile_set})"
214 And I press "bim.edit_assigned_material(material_set={profile_set})"
215 And the variable "type" is "{ifc}.by_type('IfcWallType')[0].id()"
216 And I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')"
217 Then the object "IfcWall/Cube" has a "SweptSolid" representation of "Model/Body/MODEL_VIEW"
218
219 Scenario: Get representation IFC parameters
220 Given an empty IFC project
221 And I add a cube
222 And the object "Cube" is selected
223 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
224 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
225 And I press "bim.assign_class"
226 And I press "bim.update_representation(ifc_representation_class='IfcExtrudedAreaSolid/IfcRectangleProfileDef')"
227 When I press "bim.get_representation_ifc_parameters"
228 Then nothing happens
229
230 Scenario: Copy representation
231 Given an empty IFC project
232 And I add a cube
233 And the object "Cube" is selected
234 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
235 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
236 And I press "bim.assign_class"
237 And I add a cube
238 And the object "Cube" is selected
239 And I press "bim.assign_class"
240 And the object "IfcWall/Cube" is selected
241 And additionally the object "IfcWall/Cube.001" is selected
242 When I press "bim.copy_representation"
243 Then nothing happens
244
245 Scenario: Override delete - without active IFC data
246 Given an empty Blender session
247 And I add a cube
248 And the object "Cube" is selected
249 When I press "bim.override_object_delete"
250 Then the object "Cube" does not exist
251
252 Scenario: Override delete - with active IFC data
253 Given an empty IFC project
254 And I add a cube
255 And the object "Cube" is selected
256 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
257 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
258 And I press "bim.assign_class"
259 And the object "IfcWall/Cube" is selected
260 When I press "bim.override_object_delete"
261 Then the object "IfcWall/Cube" does not exist
262
263 Scenario: Override outliner delete
264 Given an untestable scenario
265 Then nothing happens
266
267 Scenario: Override duplicate move - without active IFC data
268 Given an empty Blender session
269 And I add a cube
270 And I add an empty
271 And the object "Cube" is selected
272 And additionally the object "Empty" is selected
273 When I duplicate the selected objects
274 Then the object "Cube" exists
275 And the object "Cube.001" exists
276
277 Scenario: Override duplicate move - with active IFC data
278 Given an empty IFC project
279 And I add a cube
280 And the object "Cube" is selected
281 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
282 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
283 And I press "bim.assign_class"
284 And the object "IfcWall/Cube" is selected
285 And additionally the object "IfcBuildingStorey/My Storey" is selected
286 And I set "scene.BIMSpatialDecompositionProperties.is_locked" to "False"
287 When I duplicate the selected objects
288 Then the object "IfcWall/Cube" exists
289 And the object "IfcWall/Cube" is an "IfcWall"
290 And the object "IfcWall/Cube.001" exists
291 And the object "IfcWall/Cube.001" is an "IfcWall"
292 And the object "IfcWall/Cube.001" has a "Tessellation" representation of "Model/Body/MODEL_VIEW"
293 And the object "IfcBuildingStorey/My Storey.001" does not exist
294
295 Scenario: Override duplicate move - with unlocked elements
296 Given an empty IFC project
297 And I add a cube
298 And the object "Cube" is selected
299 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
300 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
301 And I press "bim.assign_class"
302 And the object "IfcBuildingStorey/My Storey" is selected
303 And I set "scene.BIMSpatialDecompositionProperties.is_locked" to "False"
304 When I duplicate the selected objects
305 Then the object "IfcBuildingStorey/My Storey.001" exists
306 And the object "IfcBuildingStorey/My Storey.001" is an "IfcBuildingStorey"
307
308 Scenario: Override duplicate move - copying a coloured representation
309 Given an empty IFC project
310 And I add a cube
311 And the object "Cube" is selected
312 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
313 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
314 And I press "bim.assign_class"
315 And the object "IfcWall/Cube" is selected
316 And I press "bim.load_styles(style_type='IfcSurfaceStyle')"
317 And I press "bim.enable_adding_presentation_style"
318 And I set "scene.BIMStylesProperties.style_name" to "Style"
319 And I set "scene.BIMStylesProperties.surface_colour" to "[1.0,0.0,0.0]"
320 And I press "bim.add_presentation_style"
321 And the variable "style" is "{ifc}.by_type('IfcSurfaceStyle')[0].id()"
322 And I press "bim.assign_style_to_selected(style_id={style})"
323 When I duplicate the selected objects
324 And I press "bim.save_project(filepath='{cwd}/test/files/temp/export.ifc')"
325 And an empty Blender session is started
326 And I press "bim.load_project(filepath='{cwd}/test/files/temp/export.ifc', should_start_fresh_session=False)"
327 Then the material "Style" colour is "1,0,0,1"
328 And the object "IfcWall/Cube" has the material "Style"
329 And the object "IfcWall/Cube.001" has the material "Style"
330
331 Scenario: Override duplicate move - copying a type instance with a representation map
332 Given an empty IFC project
333 And I add a cube
334 And the object "Cube" is selected
335 And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType"
336 And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType"
337 And I press "bim.assign_class"
338 And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType"
339 And the variable "cube" is "{ifc}.by_type('IfcWallType')[0].id()"
340 And I set "scene.BIMModelProperties.relating_type_id" to "{cube}"
341 And I press "bim.add_occurrence"
342 And the object "IfcWall/Wall" is selected
343 When I duplicate the selected objects
344 Then the object "IfcWall/Wall.001" exists
345 And the object "IfcWall/Wall.001" has a "MappedRepresentation" representation of "Model/Body/MODEL_VIEW"
346
347 Scenario: Override duplicate move - copying a layered extrusion
348 Given an empty IFC project
349 And I add a cube
350 And the object "Cube" is selected
351 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
352 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
353 And I press "bim.assign_class"
354 And I add an empty
355 And the object "Empty" is selected
356 And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType"
357 And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType"
358 And I press "bim.assign_class"
359 And I press "bim.add_material()"
360 And I set "active_object.BIMObjectMaterialProperties.material_type" to "IfcMaterialLayerSet"
361 And I press "bim.assign_material"
362 And I press "bim.enable_editing_assigned_material"
363 And the variable "layer_set" is "{ifc}.by_type("IfcMaterialLayerSet")[0].id()"
364 And I press "bim.add_layer(layer_set={layer_set})"
365 And the variable "layer" is "{ifc}.by_type("IfcMaterialLayer")[0].id()"
366 And I press "bim.enable_editing_material_set_item(material_set_item={layer})"
367 And I set "active_object.BIMObjectMaterialProperties.material_set_item_attributes[0].float_value" to "0.1"
368 And I press "bim.edit_material_set_item(material_set_item={layer})"
369 And I press "bim.edit_assigned_material(material_set={layer_set})"
370 And the variable "type" is "{ifc}.by_type('IfcWallType')[0].id()"
371 And I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')"
372 And the object "IfcWall/Cube" is selected
373 When I duplicate the selected objects
374 Then the object "IfcWall/Cube.001" exists
375 Then the object "IfcWall/Cube.001" has a "SweptSolid" representation of "Model/Body/MODEL_VIEW"
376
377 Scenario: Override duplicate move - copying a profiled extrusion
378 Given an empty IFC project
379 And I add a cube
380 And the object "Cube" is selected
381 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
382 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
383 And I press "bim.assign_class"
384 And I add an empty
385 And the object "Empty" is selected
386 And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType"
387 And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType"
388 And I press "bim.assign_class"
389 And I press "bim.add_material()"
390 And I set "active_object.BIMObjectMaterialProperties.material_type" to "IfcMaterialProfileSet"
391 And I press "bim.assign_material"
392 And I press "bim.enable_editing_assigned_material"
393 And I press "bim.add_profile_def"
394 And the variable "profile_set" is "{ifc}.by_type("IfcMaterialProfileSet")[0].id()"
395 And I press "bim.add_profile(profile_set={profile_set})"
396 And I press "bim.edit_assigned_material(material_set={profile_set})"
397 And the variable "type" is "{ifc}.by_type('IfcWallType')[0].id()"
398 And I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')"
399 And the object "IfcWall/Cube" is selected
400 When I duplicate the selected objects
401 Then the object "IfcWall/Cube.001" exists
402 Then the object "IfcWall/Cube.001" has a "SweptSolid" representation of "Model/Body/MODEL_VIEW"
403
404 Scenario: Override duplicate move - copying an aggregate
405 Given an empty IFC project
406 And I add a cube
407 And the object "Cube" is selected
408 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
409 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
410 And I press "bim.assign_class"
411 And the object "IfcWall/Cube" is selected
412 When I press "bim.add_aggregate(aggregate_name='Assembly')"
413 When the object "IfcWall/Cube" is selected
414 And additionally the object "IfcElementAssembly/Assembly" is selected
415 When I duplicate the selected objects
416 Then the object "IfcWall/Cube.001" exists
417 And the object "IfcElementAssembly/Assembly.001" exists
418 And the object "IfcWall/Cube.001" is aggregated by object "IfcElementAssembly/Assembly.001"
419 And the object "IfcElementAssembly/Assembly.001" is contained in object "IfcBuildingStorey/My Storey"
420
421 Scenario: Override duplicate move - copying objects with connection
422 Given an empty IFC project
423 And I load the demo construction library
424 And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType"
425 And the variable "element_type" is "[e for e in {ifc}.by_type('IfcWallType') if e.Name == 'WAL100'][0].id()"
426 And I set "scene.BIMModelProperties.relating_type_id" to "{element_type}"
427 When I press "bim.add_occurrence"
428 Then the object "IfcWall/Wall" is an "IfcWall"
429 And the object "IfcWall/Wall" dimensions are "1,0.1,3"
430 And the object "IfcWall/Wall" bottom left corner is at "0,0,0"
431 When I set "scene.BIMModelProperties.ifc_class" to "IfcSlabType"
432 And the variable "element_type" is "[e for e in {ifc}.by_type('IfcSlabType') if e.Name == 'FLR200'][0].id()"
433 And I set "scene.BIMModelProperties.relating_type_id" to "{element_type}"
434 When I press "bim.add_occurrence"
435 Then the object "IfcSlab/Slab" is an "IfcSlab"
436 When the object "IfcSlab/Slab" is selected
437 And the object "IfcSlab/Slab" is moved to "0,0,4"
438 When I deselect all objects
439 And the object "IfcWall/Wall" is selected
440 And additionally the object "IfcSlab/Slab" is selected
441 When I press "bim.hotkey(hotkey='S_E')"
442 Then the object "IfcWall/Wall" dimensions are "1,0.1,4"
443 When I duplicate the selected objects
444 Then the object "IfcWall/Wall.001" exists
445 And the variable "wall_name" is "[o.name for o in bpy.context.selected_objects if o.name == 'IfcWall/Wall.001'][0]"
446 Then the object "IfcSlab/Slab.001" exists
447 And the variable "slab_name" is "[o.name for o in bpy.context.selected_objects if o.name == 'IfcSlab/Slab.001'][0]"
448 Then the object "{wall_name}" has a connection with "{slab_name}"
449
450 Scenario: Override duplicate move - copying walls with mitre joint
451 Given an empty IFC project
452 And I load the demo construction library
453 And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType"
454 And the variable "element_type" is "[e for e in {ifc}.by_type('IfcWallType') if e.Name == 'WAL100'][0].id()"
455 And I set "scene.BIMModelProperties.relating_type_id" to "{element_type}"
456 And I press "bim.add_occurrence"
457 And the cursor is at "0.5,0,0"
458 And I press "bim.add_occurrence"
459 And the object "IfcWall/Wall.001" is selected
460 And additionally the object "IfcWall/Wall" is selected
461 When I press "bim.hotkey(hotkey='S_T')"
462 Then the object "IfcWall/Wall" dimensions are "0.6,0.1,3"
463 And the object "IfcWall/Wall" bottom left corner is at "0,0,0"
464 And the object "IfcWall/Wall.001" dimensions are "1.1,0.1,3"
465 And the object "IfcWall/Wall.001" bottom left corner is at "0.5,0.1,0"
466 And the object "IfcWall/Wall.001" top right corner is at "0.6,-1,3"
467 When I deselect all objects
468 And the object "IfcWall/Wall.001" is selected
469 And additionally the object "IfcWall/Wall" is selected
470 When I duplicate the selected objects
471 Then the object "IfcWall/Wall.002" exists
472 And the variable "wall_name1" is "[o.name for o in bpy.context.selected_objects if o.name == 'IfcWall/Wall.002'][0]"
473 Then the object "IfcWall/Wall.003" exists
474 And the variable "wall_name2" is "[o.name for o in bpy.context.selected_objects if o.name == 'IfcWall/Wall.003'][0]"
475 Then the object "{wall_name1}" has a connection with "{wall_name2}"
476
477 Scenario: Override duplicate move linked - without active IFC data
478 Given an empty Blender session
479 And I add a cube
480 And I add an empty
481 And the object "Cube" is selected
482 And additionally the object "Empty" is selected
483 When I press "object.duplicate_move_linked"
484 Then the object "Cube" exists
485 And the object "Cube.001" exists
486
487 Scenario: Override duplicate move linked - with active IFC data
488 Given an empty IFC project
489 And I add a cube
490 And the object "Cube" is selected
491 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
492 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
493 And I press "bim.assign_class"
494 And the object "IfcWall/Cube" is selected
495 And additionally the object "IfcBuildingStorey/My Storey" is selected
496 When I press "object.duplicate_move_linked"
497 Then the object "IfcWall/Cube" exists
498 And the object "IfcWall/Cube" is an "IfcWall"
499 And the object "IfcWall/Cube.001" exists
500 And the object "IfcWall/Cube.001" is an "IfcWall"
501 And the object "IfcWall/Cube.001" has a "Tessellation" representation of "Model/Body/MODEL_VIEW"
502 And the object "IfcBuildingStorey/My Storey.001" exists
503 And the object "IfcBuildingStorey/My Storey.001" is an "IfcBuildingStorey"
504
505 Scenario: Override paste buffer - without active IFC data
506 Given an empty Blender session
507 And I add a cube
508 And I add an empty
509 And the object "Cube" is selected
510 And additionally the object "Empty" is selected
511 When I press "view3d.copybuffer"
512 And I press "bim.override_paste_buffer"
513 Then the object "Cube" exists
514 And the object "Cube.001" exists
515
516 Scenario: Override paste buffer - with active IFC data
517 Given an empty IFC project
518 And I add a cube
519 And the object "Cube" is selected
520 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
521 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
522 And I press "bim.assign_class"
523 And the object "IfcWall/Cube" is selected
524 And additionally the object "IfcBuildingStorey/My Storey" is selected
525 When I press "view3d.copybuffer"
526 # IFC elements unlinked on paste for safety
527 And I press "bim.override_paste_buffer"
528 Then the object "IfcWall/Cube" exists
529 And the object "IfcWall/Cube" is an "IfcWall"
530 And the object "Cube.001" exists
531 And the object "Cube.001" is not an IFC element
532 And the object "My Storey.001" exists
533 And the object "My Storey.001" is not an IFC element
534
535 Scenario: Duplicate linked aggregate
536 Given I load the IFC test file "/test/files/linked-aggregates.ifc"
537 And the object "IfcWall/Wall_01" is selected
538 When I duplicate linked aggregate the selected objects
539 Then the object "IfcWall/Wall_01.001" exists
540 And the object "IfcWall/Wall_02.001" exists
541 And the object "IfcElementAssembly/Assembly_01" exists
542 Then the object "IfcElementAssembly/Assembly" and "IfcElementAssembly/Assembly_01" belong to the same Linked Aggregate Group
543
544 Scenario: Refresh linked aggregate
545 Given I load the IFC test file "/test/files/linked-aggregates.ifc"
546 And the object "IfcWall/Wall_01" is selected
547 When I duplicate linked aggregate the selected objects
548 Then the object "IfcWall/Wall_01.001" exists
549 When I deselect all objects
550 And the object "IfcWall/Wall_01.001" is selected
551 When the object layer length is set to "3"
552 # Extra 0.1 due to mitre
553 Then the object "IfcWall/Wall_01.001" dimensions are "3.1,0.1,3"
554 When I refresh linked aggregate the selected object
555 Then the object "IfcWall/Wall_01" exists
556 And the object "IfcWall/Wall_01" dimensions are "3.1,0.1,3"
557
558 Scenario: Refresh linked aggregate - after deleting an object
559 Given I load the IFC test file "/test/files/linked-aggregates.ifc"
560 And the object "IfcWall/Wall_01" is selected
561 When I duplicate linked aggregate the selected objects
562 Then the object "IfcWall/Wall_01.001" exists
563 When I deselect all objects
564 And the object "IfcWall/Wall_01.001" is selected
565 And I delete the selected objects
566 When I deselect all objects
567 And the object "IfcWall/Wall_02.001" is selected
568 When I refresh linked aggregate the selected object
569 Then the object "IfcWall/Wall_01" does not exist
570 And the object "IfcWall/Wall_02" exists
571
572 Scenario: Refresh linked aggregate - after duplicating an object
573 Given I load the IFC test file "/test/files/linked-aggregates.ifc"
574 And the object "IfcWall/Wall_01" is selected
575 When I duplicate linked aggregate the selected objects
576 Then the object "IfcWall/Wall_01.001" exists
577 And the object "IfcWall/Wall_02.001" exists
578 When I deselect all objects
579 And the object "IfcWall/Wall_01" is selected
580 When I duplicate the selected objects
581 Then the object "IfcWall/Wall_01.002" exists
582 When I rename the object "IfcWall/Wall_01.002" to "IfcWall/Wall_03"
583 And I deselect all objects
584 And the object "IfcWall/Wall_03" is selected
585 When I refresh linked aggregate the selected object
586 Then the object "IfcWall/Wall_01.001" exists
587 And the object "IfcWall/Wall_02.001" exists
588 And the object "IfcWall/Wall_03.001" exists