From 6599f74d11ea9c4f4ee6ba228627e697c2479fc0 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 20 Jun 2025 13:09:16 +0500 Subject: [PATCH] Make Bonsai IfcApplication identifier unique To avoid validation errors. --- src/bonsai/bonsai/bim/handler.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bonsai/bonsai/bim/handler.py b/src/bonsai/bonsai/bim/handler.py index 48931cc4f1..eda1936dbc 100644 --- a/src/bonsai/bonsai/bim/handler.py +++ b/src/bonsai/bonsai/bim/handler.py @@ -287,14 +287,15 @@ def get_application(ifc: ifcopenshell.file) -> ifcopenshell.entity_instance: # Use only main part from the version to avoid flooding advanced users projects with IfcApplications. version = tool.Blender.get_bonsai_version().split("-")[0] + identifier = f"Bonsai-{version}" for element in ifc.by_type("IfcApplication"): - if element.ApplicationIdentifier == "Bonsai" and element.Version == version: + if element.ApplicationIdentifier == identifier: return element application = ifcopenshell.api.owner.add_application( ifc, version=version, application_full_name="Bonsai", - application_identifier="Bonsai", + application_identifier=identifier, ) SettingsCache.APPLICATION_ID = application.id() SettingsCache.set_file(ifc)