mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
bim.execute_ifc_clash - more user-friendly error when one of the filepaths do not exist
This commit is contained in:
@@ -24,6 +24,7 @@ import logging
|
||||
import numpy as np
|
||||
import ifcopenshell
|
||||
import bonsai.tool as tool
|
||||
from pathlib import Path
|
||||
from bpy_extras.io_utils import ExportHelper, ImportHelper
|
||||
from math import radians
|
||||
from mathutils import Matrix, Vector
|
||||
@@ -226,6 +227,16 @@ class ExecuteIfcClash(bpy.types.Operator, ExportHelper):
|
||||
|
||||
self.props = tool.Clash.get_clash_props()
|
||||
|
||||
for clash_set in self.props.clash_sets:
|
||||
for clash_sources in clash_set.get_clash_sources().values():
|
||||
for clash_source in clash_sources:
|
||||
if not Path(clash_source.name).is_file():
|
||||
self.report(
|
||||
{"ERROR"},
|
||||
f"One of the provided clash source filepaths do not exist: '{clash_source.name}'.",
|
||||
)
|
||||
return {"CANCELLED"}
|
||||
|
||||
_, extension = os.path.splitext(self.filepath)
|
||||
if extension != ".bcf":
|
||||
self.filepath = bpy.path.ensure_ext(self.filepath, ".json")
|
||||
|
||||
Reference in New Issue
Block a user