You can now specify a set of custom step definitions to BIMTester.

This commit is contained in:
Dion Moult
2021-02-03 21:58:49 +11:00
parent 4b9520a1bb
commit 11697fbd47
6 changed files with 36 additions and 2 deletions
@@ -5,6 +5,7 @@ classes = (
operator.ExecuteBIMTester,
operator.BIMTesterPurge,
operator.SelectFeature,
operator.SelectSteps,
operator.SelectBIMTesterIfcFile,
operator.RejectElement,
operator.ApproveClass,
@@ -29,7 +29,8 @@ class ExecuteBIMTester(bpy.types.Operator):
"path": "",
"report": report,
"schema": "",
"lang": "en"
"lang": "en",
"steps": props.steps
}
use_stored_ifc = props.should_load_from_memory and IfcStore.get_file()
runner = bimtester.run.TestRunner(args["ifc"], ifc=IfcStore.get_file() if use_stored_ifc else None)
@@ -71,6 +72,22 @@ class SelectFeature(bpy.types.Operator):
return {"RUNNING_MODAL"}
class SelectSteps(bpy.types.Operator):
bl_idname = "bim.select_steps"
bl_label = "Select Steps"
filename_ext = ".py"
filter_glob: bpy.props.StringProperty(default="*.py", options={"HIDDEN"})
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
def execute(self, context):
bpy.context.scene.BimTesterProperties.steps = self.filepath
return {"FINISHED"}
def invoke(self, context, event):
context.window_manager.fileselect_add(self)
return {"RUNNING_MODAL"}
class SelectBIMTesterIfcFile(bpy.types.Operator):
bl_idname = "bim.select_bimtester_ifc_file"
bl_label = "Select BIMTester IFC File"
@@ -42,6 +42,7 @@ def refreshScenarios(self, context):
class BimTesterProperties(PropertyGroup):
feature: StringProperty(default="", name="Feature File", update=refreshScenarios)
steps: StringProperty(default="", name="Custom Steps")
ifc_file: StringProperty(default="", name="IFC File")
audit_ifc_class: EnumProperty(items=getIfcClasses, name="Audit Class")
qa_reject_element_reason: StringProperty(name="Element Rejection Reason")
@@ -28,6 +28,10 @@ class BIM_PT_qa(Panel):
row.prop(props, "feature")
row.operator("bim.select_feature", icon="FILE_FOLDER", text="")
row = self.layout.row(align=True)
row.prop(props, "steps")
row.operator("bim.select_steps", icon="FILE_FOLDER", text="")
has_ifc_file = (IfcStore.get_file() and props.should_load_from_memory) or (
props.ifc_file and not props.should_load_from_memory
)