Debian Codegraph @

src/bonsai/test/bim/feature/pset.feature

raw
1 @pset
2 Feature: Pset
3
4 Scenario: Add pset - object
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 And I set "active_object.PsetProperties.pset_name" to "Pset_WallCommon"
13 When I press "bim.add_pset(obj='IfcWall/Cube', obj_type='Object')"
14 Then nothing happens
15
16 Scenario: Add pset - multiple objects
17 Given an empty IFC project
18 And I add a cube
19 And the object "Cube" is selected
20 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
21 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
22 And I press "bim.assign_class"
23 And the object "IfcWall/Cube" is selected
24 And I add a cube
25 And the object "Cube" is selected
26 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
27 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
28 And I press "bim.assign_class"
29 And the object "IfcWall/Cube" is selected
30 And additionally the object "IfcWall/Cube.001" is selected
31 And I set "active_object.PsetProperties.pset_name" to "Pset_WallCommon"
32 When I press "bim.add_pset(obj='IfcWall/Cube', obj_type='Object')"
33 Then nothing happens
34
35 Scenario: Enable pset editing - object
36 Given an empty IFC project
37 And I add a cube
38 And the object "Cube" is selected
39 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
40 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
41 And I press "bim.assign_class"
42 And the object "IfcWall/Cube" is selected
43 And I set "active_object.PsetProperties.pset_name" to "Pset_WallCommon"
44 And I press "bim.add_pset(obj='IfcWall/Cube', obj_type='Object')"
45 And I set "active_object.PsetProperties.properties[0].metadata.string_value" to "Foobar"
46 And I press "bim.edit_pset(obj='IfcWall/Cube', obj_type='Object')"
47 And the variable "pset" is "{ifc}.by_type('IfcPropertySet')[-1].id()"
48 When I press "bim.enable_pset_editing(pset_id={pset}, obj='IfcWall/Cube', obj_type='Object')"
49 Then nothing happens
50
51 Scenario: Enable pset editing - material
52 Given an empty IFC project
53 And I press "bim.add_material()"
54 And I press "bim.load_materials"
55 And I press "bim.expand_material_category(category='Uncategorised')"
56 And I set "scene.BIMMaterialProperties.active_material_index" to "1"
57 And I set "scene.MaterialPsetProperties.pset_name" to "Pset_MaterialCommon"
58 And I press "bim.add_pset(obj='', obj_type='Material')"
59 And I set "scene.MaterialPsetProperties.properties[0].metadata.float_value" to "0.42"
60 And I press "bim.edit_pset(obj='', obj_type='Material')"
61 And the variable "pset" is "{ifc}.by_type('IfcMaterialProperties')[-1].id()"
62 When I press "bim.enable_pset_editing(pset_id={pset}, obj='', obj_type='Material')"
63 Then nothing happens
64
65 Scenario: Enable pset editing - profile
66 Given an empty IFC project
67 And I press "bim.load_profiles"
68 And I press "bim.add_profile_def"
69 And I set "scene.ProfilePsetProperties.pset_name" to "Pset_ProfileMechanical"
70 And I press "bim.add_pset(obj_type='Profile')"
71 And I set "scene.ProfilePsetProperties.properties[0].metadata.float_value" to "0.42"
72 And I press "bim.edit_pset(obj='', obj_type='Profile')"
73 And the variable "pset" is "{ifc}.by_type('IfcProfileProperties')[-1].id()"
74 When I press "bim.enable_pset_editing(pset_id={pset}, obj='', obj_type='Profile')"
75 Then nothing happens
76
77 Scenario: Enable pset editing - work schedule
78 Given an empty IFC project
79 And I press "bim.add_work_schedule"
80 And the variable "work_schedule" is "{ifc}.by_type('IfcWorkSchedule')[0].id()"
81 And I press "bim.enable_editing_work_schedule_tasks(work_schedule={work_schedule})"
82 And I set "scene.WorkSchedulePsetProperties.pset_name" to "Pset_WorkControlCommon"
83 And I press "bim.add_pset(obj_type='WorkSchedule')"
84 And I set "scene.WorkSchedulePsetProperties.properties[0].metadata.string_value" to "Foobar"
85 And I press "bim.edit_pset(obj='', obj_type='WorkSchedule')"
86 And the variable "pset" is "{ifc}.by_type('IfcPropertySet')[-1].id()"
87 When I press "bim.enable_pset_editing(pset_id={pset}, obj='', obj_type='WorkSchedule')"
88 Then nothing happens
89
90 Scenario: Enable pset editing - resource with time series properties
91 Given an empty IFC project
92 And I press "bim.load_resources"
93 And I press "bim.add_resource(ifc_class='IfcSubContractResource', parent_resource=0)"
94 And I set "scene.ResourcePsetProperties.pset_name" to "Pset_ConstructionResource"
95 When I press "bim.add_pset(obj_type='Resource')"
96 Then nothing happens
97
98 Scenario: Enable pset editing - resource with regular single properties
99 Given an empty IFC project
100 And I press "bim.load_resources"
101 And I press "bim.add_resource(ifc_class='IfcCrewResource', parent_resource=0)"
102 And the variable "resource" is "{ifc}.by_type('IfcCrewResource')[-1].id()"
103 And I press "bim.add_resource(ifc_class='IfcLaborResource', parent_resource={resource})"
104 And I set "scene.BIMResourceProperties.active_resource_index" to "1"
105 And I set "scene.ResourcePsetProperties.pset_name" to "EPset_Productivity"
106 And I press "bim.add_pset(obj_type='Resource')"
107 And I set "scene.ResourcePsetProperties.properties[0].metadata.string_value" to "Foobar"
108 And I press "bim.edit_pset(obj='', obj_type='Resource')"
109 And the variable "pset" is "{ifc}.by_type('IfcPropertySet')[-1].id()"
110 When I press "bim.enable_pset_editing(pset_id={pset}, obj='', obj_type='Resource')"
111 Then nothing happens
112
113 Scenario: Enable pset editing - task
114 Given an empty IFC project
115 And I press "bim.add_work_schedule"
116 And the variable "work_schedule" is "IfcStore.get_file().by_type('IfcWorkSchedule')[0].id()"
117 And I press "bim.enable_editing_work_schedule_tasks(work_schedule={work_schedule})"
118 And I press "bim.add_summary_task(work_schedule={work_schedule})"
119 And I set "scene.TaskPsetProperties.qto_name" to "Qto_TaskBaseQuantities"
120 And I press "bim.add_qto(obj_type='Task')"
121 And I set "scene.TaskPsetProperties.properties[0].metadata.float_value" to "0.42"
122 And I press "bim.edit_pset(obj='', obj_type='Task')"
123 And the variable "pset" is "{ifc}.by_type('IfcElementQuantity')[-1].id()"
124 When I press "bim.enable_pset_editing(pset_id={pset}, obj='', obj_type='Task')"
125 Then nothing happens
126
127 Scenario: Disable pset editing - object
128 Given an empty IFC project
129 And I add a cube
130 And the object "Cube" is selected
131 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
132 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
133 And I press "bim.assign_class"
134 And the object "IfcWall/Cube" is selected
135 And I set "active_object.PsetProperties.pset_name" to "Pset_WallCommon"
136 And I press "bim.add_pset(obj='IfcWall/Cube', obj_type='Object')"
137 When I press "bim.disable_pset_editing(obj='IfcWall/Cube', obj_type='Object')"
138 Then nothing happens
139
140 Scenario: Disable pset editing - material
141 Given an empty IFC project
142 And I press "bim.add_material()"
143 And I press "bim.load_materials"
144 And I press "bim.expand_material_category(category='Uncategorised')"
145 And I set "scene.BIMMaterialProperties.active_material_index" to "1"
146 And I press "bim.add_pset(obj='Default', obj_type='Material')"
147 When I press "bim.disable_pset_editing(obj='Default', obj_type='Material')"
148 Then nothing happens
149
150 Scenario: Disable pset editing - profile
151 Given an empty IFC project
152 And I press "bim.load_profiles"
153 And I press "bim.add_profile_def"
154 And I set "scene.ProfilePsetProperties.pset_name" to "Pset_ProfileMechanical"
155 And I press "bim.add_pset(obj_type='Profile')"
156 When I press "bim.disable_pset_editing(obj='', obj_type='Profile')"
157 Then nothing happens
158
159 Scenario: Disable pset editing - work schedule
160 Given an empty IFC project
161 And I press "bim.add_work_schedule"
162 And the variable "work_schedule" is "{ifc}.by_type('IfcWorkSchedule')[0].id()"
163 And I press "bim.enable_editing_work_schedule_tasks(work_schedule={work_schedule})"
164 And I set "scene.WorkSchedulePsetProperties.pset_name" to "Pset_WorkControlCommon"
165 And I press "bim.add_pset(obj_type='WorkSchedule')"
166 When I press "bim.disable_pset_editing(obj='', obj_type='WorkSchedule')"
167 Then nothing happens
168
169 Scenario: Disable pset editing - resource with time series properties
170 Given an empty IFC project
171 And I press "bim.load_resources"
172 And I press "bim.add_resource(ifc_class='IfcSubContractResource', parent_resource=0)"
173 And I set "scene.ResourcePsetProperties.pset_name" to "Pset_ConstructionResource"
174 And I press "bim.add_pset(obj_type='Resource')"
175 When I press "bim.disable_pset_editing(obj='', obj_type='Resource')"
176 Then nothing happens
177
178 Scenario: Disable pset editing - resource with regular single properties
179 Given an empty IFC project
180 And I press "bim.load_resources"
181 And I press "bim.add_resource(ifc_class='IfcCrewResource', parent_resource=0)"
182 And the variable "resource" is "{ifc}.by_type('IfcCrewResource')[-1].id()"
183 And I press "bim.add_resource(ifc_class='IfcLaborResource', parent_resource={resource})"
184 And I set "scene.BIMResourceProperties.active_resource_index" to "1"
185 And I set "scene.ResourcePsetProperties.pset_name" to "EPset_Productivity"
186 And I press "bim.add_pset(obj_type='Resource')"
187 When I press "bim.disable_pset_editing(obj='', obj_type='Resource')"
188 Then nothing happens
189
190 Scenario: Disable pset editing - task
191 Given an empty IFC project
192 And I press "bim.add_work_schedule"
193 And the variable "work_schedule" is "IfcStore.get_file().by_type('IfcWorkSchedule')[0].id()"
194 And I press "bim.enable_editing_work_schedule_tasks(work_schedule={work_schedule})"
195 And I press "bim.add_summary_task(work_schedule={work_schedule})"
196 And I set "scene.TaskPsetProperties.qto_name" to "Qto_TaskBaseQuantities"
197 And I press "bim.add_qto(obj_type='Task')"
198 When I press "bim.disable_pset_editing(obj='', obj_type='Task')"
199 Then nothing happens
200
201 Scenario: Edit pset - object
202 Given an empty IFC project
203 And I add a cube
204 And the object "Cube" is selected
205 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
206 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
207 And I press "bim.assign_class"
208 And the object "IfcWall/Cube" is selected
209 And I set "active_object.PsetProperties.pset_name" to "Pset_WallCommon"
210 And I press "bim.add_pset(obj='IfcWall/Cube', obj_type='Object')"
211 When I press "bim.edit_pset(obj='IfcWall/Cube', obj_type='Object')"
212 Then nothing happens
213
214 Scenario: Edit qto - object
215 Given an empty IFC project
216 And I add a cube
217 And the object "Cube" is selected
218 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
219 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
220 And I press "bim.assign_class"
221 And the object "IfcWall/Cube" is selected
222 And I set "active_object.PsetProperties.qto_name" to "Qto_WallBaseQuantities"
223 When I press "bim.add_qto(obj='IfcWall/Cube', obj_type='Object')"
224 And I set "active_object.PsetProperties.properties[0].metadata.float_value" to "0.42"
225 And I press "bim.edit_pset(obj='IfcWall/Cube', obj_type='Object')"
226 Then nothing happens
227
228 Scenario: Edit pset - material
229 Given an empty IFC project
230 And I press "bim.add_material()"
231 And I press "bim.load_materials"
232 And I press "bim.expand_material_category(category='Uncategorised')"
233 And I set "scene.BIMMaterialProperties.active_material_index" to "1"
234 And I press "bim.add_pset(obj='', obj_type='Material')"
235 When I press "bim.edit_pset(obj='', obj_type='Material')"
236 Then nothing happens
237
238 Scenario: Edit pset - profile
239 Given an empty IFC project
240 And I press "bim.load_profiles"
241 And I press "bim.add_profile_def"
242 And I set "scene.ProfilePsetProperties.pset_name" to "Pset_ProfileMechanical"
243 And I press "bim.add_pset(obj_type='Profile')"
244 When I press "bim.edit_pset(obj='', obj_type='Profile')"
245 Then nothing happens
246
247 Scenario: Edit pset - work schedule
248 Given an empty IFC project
249 And I press "bim.add_work_schedule"
250 And the variable "work_schedule" is "{ifc}.by_type('IfcWorkSchedule')[0].id()"
251 And I press "bim.enable_editing_work_schedule_tasks(work_schedule={work_schedule})"
252 And I set "scene.WorkSchedulePsetProperties.pset_name" to "Pset_WorkControlCommon"
253 And I press "bim.add_pset(obj_type='WorkSchedule')"
254 When I press "bim.edit_pset(obj='', obj_type='WorkSchedule')"
255 Then nothing happens
256
257 Scenario: Edit pset - resource with time series properties
258 Given an empty IFC project
259 And I press "bim.load_resources"
260 And I press "bim.add_resource(ifc_class='IfcSubContractResource', parent_resource=0)"
261 And I set "scene.ResourcePsetProperties.pset_name" to "Pset_ConstructionResource"
262 And I press "bim.add_pset(obj_type='Resource')"
263 When I press "bim.edit_pset(obj='', obj_type='Resource')"
264 Then nothing happens
265
266 Scenario: Edit pset - resource with regular single properties
267 Given an empty IFC project
268 And I press "bim.load_resources"
269 And I press "bim.add_resource(ifc_class='IfcCrewResource', parent_resource=0)"
270 And the variable "resource" is "{ifc}.by_type('IfcCrewResource')[-1].id()"
271 And I press "bim.add_resource(ifc_class='IfcLaborResource', parent_resource={resource})"
272 And I set "scene.BIMResourceProperties.active_resource_index" to "1"
273 And I set "scene.ResourcePsetProperties.pset_name" to "EPset_Productivity"
274 And I press "bim.add_pset(obj_type='Resource')"
275 When I press "bim.edit_pset(obj='', obj_type='Resource')"
276 Then nothing happens
277
278 Scenario: Edit pset - task
279 Given an empty IFC project
280 And I press "bim.add_work_schedule"
281 And the variable "work_schedule" is "IfcStore.get_file().by_type('IfcWorkSchedule')[0].id()"
282 And I press "bim.enable_editing_work_schedule_tasks(work_schedule={work_schedule})"
283 And I press "bim.add_summary_task(work_schedule={work_schedule})"
284 And I set "scene.TaskPsetProperties.qto_name" to "Qto_TaskBaseQuantities"
285 And I press "bim.add_qto(obj_type='Task')"
286 When I press "bim.edit_pset(obj='', obj_type='Task')"
287 Then nothing happens
288
289 Scenario: Copy property to selected - copy property
290 Given an empty IFC project
291 And I add a cube
292 And the object "Cube" is selected
293 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
294 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
295 And I press "bim.assign_class"
296 And I add a cube
297 And the object "Cube" is selected
298 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
299 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
300 And I press "bim.assign_class"
301 And the object "IfcWall/Cube" is selected
302 And additionally the object "IfcWall/Cube.001" is selected
303 And I set "active_object.PsetProperties.pset_name" to "Pset_WallCommon"
304 And I press "bim.add_pset(obj='IfcWall/Cube.001', obj_type='Object')"
305 And I set "active_object.PsetProperties.properties[2].metadata.string_value" to "Foo"
306 When I press "bim.copy_property_to_selection(name='FireRating')"
307 Then nothing happens
308
309 Scenario: Remove pset - object
310 Given an empty IFC project
311 And I add a cube
312 And the object "Cube" is selected
313 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
314 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
315 And I press "bim.assign_class"
316 And the object "IfcWall/Cube" is selected
317 And I set "active_object.PsetProperties.pset_name" to "Pset_WallCommon"
318 And I press "bim.add_pset(obj='IfcWall/Cube', obj_type='Object')"
319 And I set "active_object.PsetProperties.properties[0].metadata.string_value" to "Foobar"
320 And I press "bim.edit_pset(obj='IfcWall/Cube', obj_type='Object')"
321 And the variable "pset" is "{ifc}.by_type('IfcPropertySet')[-1].id()"
322 When I press "bim.remove_pset(pset_id={pset}, obj='IfcWall/Cube', obj_type='Object')"
323 Then nothing happens
324
325 Scenario: Remove pset - multiple objects
326 Given an empty IFC project
327 And I add a cube
328 And the object "Cube" is selected
329 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
330 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
331 And I press "bim.assign_class"
332 And the object "IfcWall/Cube" is selected
333 And I add a cube
334 And the object "Cube" is selected
335 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
336 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
337 And I press "bim.assign_class"
338 And the object "IfcWall/Cube" is selected
339 And additionally the object "IfcWall/Cube.001" is selected
340 And I set "active_object.PsetProperties.pset_name" to "Pset_WallCommon"
341 And I press "bim.add_pset(obj='IfcWall/Cube.001', obj_type='Object')"
342 And I set "active_object.PsetProperties.properties[0].metadata.string_value" to "Foobar"
343 And I press "bim.edit_pset(obj='IfcWall/Cube.001', obj_type='Object')"
344 And the variable "pset" is "{ifc}.by_type('IfcPropertySet')[-1].id()"
345 When I press "bim.remove_pset(pset_id={pset}, obj='IfcWall/Cube', obj_type='Object')"
346 Then nothing happens
347
348 Scenario: Edit pset length property
349 Given an empty IFC project
350 And I press "mesh.add_stair"
351 And the variable "pset" is "tool.Pset.get_element_pset(tool.Ifc.get_entity(bpy.context.active_object), 'Pset_StairFlightCommon').id()"
352 And the variable "si_conversion" is "ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())"
353 And I press "bim.enable_pset_editing(pset_id={pset}, obj='IfcStairFlight/StairFlight', obj_type='Object')"
354
355 # Testing IfcPositiveLengthMeasure type of prop
356 Then "active_object.PsetProperties.properties['TreadLength'].metadata.special_type" is "LENGTH"
357 And "active_object.PsetProperties.properties['TreadLength'].metadata.float_value" is "250"
358 And "active_object.PsetProperties.properties['TreadLength'].metadata.length_value" is roughly "0.25"
359
360 When I set "active_object.PsetProperties.properties['TreadLength'].metadata.float_value" to "350"
361 Then "active_object.PsetProperties.properties['TreadLength'].metadata.float_value" is roughly "350"
362
363 When I set "active_object.PsetProperties.properties['TreadLength'].metadata.length_value" to "0.45"
364 Then "active_object.PsetProperties.properties['TreadLength'].metadata.float_value" is roughly "450"
365
366 # Testing IfcLengthMeasure type of prop
367 Then "active_object.PsetProperties.properties['NosingLength'].metadata.special_type" is "LENGTH"
368 And "active_object.PsetProperties.properties['NosingLength'].metadata.float_value" is "0.0"
369 And "active_object.PsetProperties.properties['NosingLength'].metadata.length_value" is roughly "0.0"
370
371 When I set "active_object.PsetProperties.properties['NosingLength'].metadata.float_value" to "350"
372 Then "active_object.PsetProperties.properties['NosingLength'].metadata.float_value" is roughly "350"
373
374 When I set "active_object.PsetProperties.properties['NosingLength'].metadata.length_value" to "0.45"
375 Then "active_object.PsetProperties.properties['NosingLength'].metadata.float_value" is roughly "450"
376
377 When I press "bim.edit_pset(obj='IfcStairFlight/StairFlight', obj_type='Object')"
378 Then nothing happens
379
380 Scenario: Edit qset length property
381 Given an empty IFC project
382 And I press "mesh.add_stair"
383 And I press "bim.perform_quantity_take_off"
384 And the variable "pset" is "tool.Pset.get_element_pset(tool.Ifc.get_entity(bpy.context.active_object), 'Qto_StairFlightBaseQuantities').id()"
385 And the variable "si_conversion" is "ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())"
386 And I press "bim.enable_pset_editing(pset_id={pset}, obj='IfcStairFlight/StairFlight', obj_type='Object')"
387
388 # Testing Q_LENGTH type of prop
389 Then "active_object.PsetProperties.properties['Length'].metadata.special_type" is "LENGTH"
390 And "active_object.PsetProperties.properties['Length'].metadata.float_value" is roughly "2156.485"
391 And "active_object.PsetProperties.properties['Length'].metadata.length_value" is roughly "2.156"
392
393 When I set "active_object.PsetProperties.properties['Length'].metadata.float_value" to "350"
394 Then "active_object.PsetProperties.properties['Length'].metadata.length_value" is roughly "0.35"
395
396 When I set "active_object.PsetProperties.properties['Length'].metadata.length_value" to "0.45"
397 Then "active_object.PsetProperties.properties['Length'].metadata.float_value" is roughly "450"
398
399 When I press "bim.edit_pset(obj='IfcStairFlight/StairFlight', obj_type='Object')"
400 Then nothing happens