mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 14:07:43 +00:00
BBIM IfcTester - option to generate ODS report
https://i.imgur.com/0JyXVK6.png
This commit is contained in:
@@ -27,7 +27,7 @@ import ifctester.reporter
|
||||
import ifcopenshell
|
||||
import blenderbim.tool as tool
|
||||
import blenderbim.bim.handler
|
||||
from blenderbim.bim.module.tester.data import TesterData
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
class ExecuteIfcTester(bpy.types.Operator, tool.Ifc.Operator):
|
||||
@@ -44,7 +44,7 @@ class ExecuteIfcTester(bpy.types.Operator, tool.Ifc.Operator):
|
||||
|
||||
with tempfile.TemporaryDirectory() as dirpath:
|
||||
start = time.time()
|
||||
output = os.path.join(dirpath, "{}.html".format(props.specs))
|
||||
output = Path(os.path.join(dirpath, "{}.html".format(props.specs)))
|
||||
|
||||
filepath = None
|
||||
if props.should_load_from_memory and tool.Ifc.get():
|
||||
@@ -65,8 +65,15 @@ class ExecuteIfcTester(bpy.types.Operator, tool.Ifc.Operator):
|
||||
if props.generate_html_report:
|
||||
engine = ifctester.reporter.Html(specs)
|
||||
engine.report()
|
||||
engine.to_file(output)
|
||||
webbrowser.open("file://" + output)
|
||||
output_path = output.as_posix()
|
||||
engine.to_file(output_path)
|
||||
webbrowser.open(f"file://{output_path}")
|
||||
|
||||
if props.generate_ods_report:
|
||||
engine = ifctester.reporter.Ods(specs)
|
||||
engine.report()
|
||||
output_path = output.with_suffix(".ods").as_posix()
|
||||
engine.to_file(output_path)
|
||||
|
||||
report = None
|
||||
report = ifctester.reporter.Json(specs).report()["specifications"]
|
||||
|
||||
@@ -52,6 +52,7 @@ class IfcTesterProperties(PropertyGroup):
|
||||
ifc_file: StringProperty(default="", name="IFC File")
|
||||
should_load_from_memory: BoolProperty(default=False, name="Load from Memory")
|
||||
generate_html_report: BoolProperty(default=False, name="Generate HTML report")
|
||||
generate_ods_report: BoolProperty(default=False, name="Generate ODS report")
|
||||
flag: BoolProperty(default=False, name="Flag Failed Entities")
|
||||
active_specification_index: IntProperty(name="Active Specification Index", update=update_active_specification_index)
|
||||
old_index: IntProperty(name="", default=0)
|
||||
|
||||
@@ -44,6 +44,8 @@ class BIM_PT_tester(Panel):
|
||||
row = self.layout.row()
|
||||
row.prop(props, "generate_html_report")
|
||||
row = self.layout.row()
|
||||
row.prop(props, "generate_ods_report")
|
||||
row = self.layout.row()
|
||||
row.prop(props, "flag")
|
||||
|
||||
if not tool.Ifc.get() or not props.should_load_from_memory:
|
||||
|
||||
Reference in New Issue
Block a user