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 6489f4dc1d
commit e1a1ba62c5
3 changed files with 18 additions and 2 deletions
@@ -28,6 +28,16 @@ import ifcopenshell.util.attribute
cwd = os.path.dirname(os.path.realpath(__file__))
def get_fallback_schema(version):
"""fallback to the schema version we do have docs and mapping for,
needed to support IFC versions like 4X3_RC1, 4X1 etc"""
if version.startswith("IFC4X3"):
version = "IFC4X3"
elif version.startswith("IFC4"):
version = "IFC4"
return version
def is_a(entity, ifc_class):
ifc_class = ifc_class.upper()
if entity.name_uc() == ifc_class: