mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 14:02:27 +00:00
Warning when user loading sheets and some svgs are missing
Added this warning because missing svgs can lead to errors later on.
This commit is contained in:
@@ -1454,6 +1454,23 @@ class LoadSheets(bpy.types.Operator, Operator):
|
|||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
core.load_sheets(tool.Drawing)
|
core.load_sheets(tool.Drawing)
|
||||||
|
|
||||||
|
props = context.scene.DocProperties
|
||||||
|
sheets_not_found = []
|
||||||
|
for sheet_prop in props.sheets:
|
||||||
|
if not sheet_prop.is_sheet:
|
||||||
|
continue
|
||||||
|
|
||||||
|
sheet = tool.Ifc.get().by_id(sheet_prop.ifc_definition_id)
|
||||||
|
document_uri = tool.Drawing.get_document_uri(sheet)
|
||||||
|
|
||||||
|
filepath = Path(document_uri)
|
||||||
|
if not filepath.is_file():
|
||||||
|
sheet_name = f"{sheet_prop.identification} - {sheet_prop.name}"
|
||||||
|
sheets_not_found.append(f'"{sheet_name}" - {document_uri}')
|
||||||
|
|
||||||
|
if sheets_not_found:
|
||||||
|
self.report({"ERROR"}, "Some sheets svg files are missing:\n" + "\n".join(sheets_not_found))
|
||||||
|
|
||||||
|
|
||||||
class DisableEditingSheets(bpy.types.Operator, Operator):
|
class DisableEditingSheets(bpy.types.Operator, Operator):
|
||||||
bl_idname = "bim.disable_editing_sheets"
|
bl_idname = "bim.disable_editing_sheets"
|
||||||
|
|||||||
Reference in New Issue
Block a user