mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
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:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user