mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 03:14:23 +00:00
Show an error if library file schema is not compatible with the current file
Example - https://i.imgur.com/t1gxBJ4.png ("Schema of library file (IFC4X3_ADD2) is not compatible with the current IFC file (IFC4).")
This commit is contained in:
@@ -160,8 +160,17 @@ class SelectLibraryFile(bpy.types.Operator, IFCFileSelector):
|
||||
|
||||
def _execute(self, context):
|
||||
filepath = self.get_filepath()
|
||||
ifc_file = tool.Ifc.get()
|
||||
library_file = ifcopenshell.open(filepath)
|
||||
if library_file.schema_identifier != ifc_file.schema_identifier:
|
||||
self.report(
|
||||
{"ERROR"},
|
||||
f"Schema of library file ({library_file.schema_identifier}) is not compatible with the current IFC file ({ifc_file.schema_identifier}).",
|
||||
)
|
||||
return {"CANCELLED"}
|
||||
|
||||
IfcStore.library_path = filepath
|
||||
IfcStore.library_file = ifcopenshell.open(filepath)
|
||||
IfcStore.library_file = library_file
|
||||
bpy.ops.bim.refresh_library()
|
||||
if context.area:
|
||||
context.area.tag_redraw()
|
||||
|
||||
Reference in New Issue
Block a user