ifcpatch - fix ifc2x3 bootstrap (c58b84d)

After c58b84d append_asset requires user to be a valid IFC entity.
This commit is contained in:
Andrej
2025-06-04 12:28:50 +05:00
parent 2da183bfa6
commit a0e4bdcbef
+8 -1
View File
@@ -46,7 +46,14 @@ class IFC2X3:
@pytest.fixture(autouse=True)
def setup(self):
self.file: ifcopenshell.file = ifcopenshell.api.run("project.create_file", version="IFC2X3")
ifcopenshell.api.owner.settings.get_user = lambda ifc: ifc.createIfcPersonAndOrganization()
def get_user(ifc_file: ifcopenshell.file) -> ifcopenshell.entity_instance:
person = ifcopenshell.api.owner.add_person(ifc_file)
organization = ifcopenshell.api.owner.add_organisation(ifc_file)
pao = ifcopenshell.api.owner.add_person_and_organisation(ifc_file, person, organization)
return pao
ifcopenshell.api.owner.settings.get_user = get_user
ifcopenshell.api.owner.settings.get_application = lambda ifc: ifc.createIfcApplication()
ifcopenshell.api.pre_listeners = {}
ifcopenshell.api.post_listeners = {}