mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 06:58:56 +00:00
Fix bug where users saw a scary error message when exporting with no IFC data
This commit is contained in:
@@ -11,6 +11,7 @@ import blenderbim.bim.module.drawing
|
|||||||
from . import export_ifc
|
from . import export_ifc
|
||||||
from . import import_ifc
|
from . import import_ifc
|
||||||
from . import schema
|
from . import schema
|
||||||
|
from blenderbim.bim.ifc import IfcStore
|
||||||
from bpy_extras.io_utils import ImportHelper
|
from bpy_extras.io_utils import ImportHelper
|
||||||
from mathutils import Vector, Matrix, Euler, geometry
|
from mathutils import Vector, Matrix, Euler, geometry
|
||||||
from math import radians, degrees, atan, tan, cos, sin
|
from math import radians, degrees, atan, tan, cos, sin
|
||||||
@@ -26,6 +27,9 @@ class ExportIFC(bpy.types.Operator):
|
|||||||
json_compact: bpy.props.BoolProperty(name="Export Compact IFCJSON", default=False)
|
json_compact: bpy.props.BoolProperty(name="Export Compact IFCJSON", default=False)
|
||||||
|
|
||||||
def invoke(self, context, event):
|
def invoke(self, context, event):
|
||||||
|
if not IfcStore.get_file():
|
||||||
|
self.report({"ERROR"}, "No IFC project is available for export - create or import a project first.")
|
||||||
|
return {"FINISHED"}
|
||||||
if bpy.context.scene.BIMProperties.ifc_file:
|
if bpy.context.scene.BIMProperties.ifc_file:
|
||||||
self.filepath = bpy.context.scene.BIMProperties.ifc_file
|
self.filepath = bpy.context.scene.BIMProperties.ifc_file
|
||||||
return self.execute(context)
|
return self.execute(context)
|
||||||
|
|||||||
Reference in New Issue
Block a user