Replace direct access to IfcStore with tool.Ifc

This commit is contained in:
Andrej730
2025-02-19 12:15:39 +05:00
parent 67bac441ad
commit 43cc7a0304
81 changed files with 228 additions and 271 deletions
+7 -7
View File
@@ -786,14 +786,14 @@ def the_ifc_material_name_does_not_exist(name):
@then("an IFC file does not exist")
def an_ifc_file_does_not_exist():
ifc = IfcStore.get_file()
ifc = tool.Ifc.get()
if ifc:
assert False, "An IFC is available"
@then("an IFC file exists")
def an_ifc_file_exists():
ifc = IfcStore.get_file()
ifc = tool.Ifc.get()
if not ifc:
assert False, "No IFC file is available"
return ifc
@@ -807,7 +807,7 @@ def the_object_name_should_display_as_mode(name, mode):
@then(parsers.parse('the object "{name}" is voided by "{void}"'))
def the_object_name_is_voided_by_void(name, void):
ifc = IfcStore.get_file()
ifc = tool.Ifc.get()
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
assert any((rel for rel in element.HasOpenings if rel.RelatedOpeningElement.Name == void)), "No void found"
@@ -823,14 +823,14 @@ def the_object_name_is_not_voided_by_void(name, void):
@then(parsers.parse('the object "{name}" is not voided'))
def the_object_name_is_not_voided(name):
ifc = IfcStore.get_file()
ifc = tool.Ifc.get()
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
assert not element.HasOpenings, "A void was found"
@then(parsers.parse('the object "{name}" is a void'))
def the_object_name_is_a_void(name):
ifc = IfcStore.get_file()
ifc = tool.Ifc.get()
obj = the_object_name_exists(name)
element = ifc.by_id(obj.BIMObjectProperties.ifc_definition_id)
assert any((element.VoidsElements)), "No void was found"
@@ -936,7 +936,7 @@ def the_object_name_has_number_vertices(name, number):
@then(parsers.parse('the void "{name}" is filled by "{filling}"'))
def the_void_name_is_filled_by_filling(name, filling):
ifc = IfcStore.get_file()
ifc = tool.Ifc.get()
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
assert any((rel.RelatedBuildingElement.Name == filling for rel in element.HasFillings)), "No filling found"
@@ -953,7 +953,7 @@ def the_void_name_is_not_filled_by_filling(name, filling):
@when(parsers.parse('the object "{name}" is not a filling'))
@then(parsers.parse('the object "{name}" is not a filling'))
def the_object_name_is_not_a_filling(name):
ifc = IfcStore.get_file()
ifc = tool.Ifc.get()
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
assert not any(element.FillsVoids), "A filling was found"