add fallback to the previous schema versions for docs and mappings

before it was breaking part of BlenderBIM UI if we would open IFC4X1 file
This commit is contained in:
Andrej730
2024-02-09 11:55:00 +05:00
parent 7c81633113
commit e2ef636209
3 changed files with 18 additions and 2 deletions
@@ -98,11 +98,14 @@ def get_db(version):
with open(schema_path, "r") as fi:
db[ifc_version][data_type] = json.load(fi)
version = ifcopenshell.util.schema.get_fallback_schema(version)
return db.get(version)
def get_schema_by_name(version):
global schema_by_name
version = ifcopenshell.util.schema.get_fallback_schema(version)
if not schema_by_name[version]:
schema_by_name[version] = ifcopenshell.ifcopenshell_wrapper.schema_by_name(version)
return schema_by_name[version]