mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
Hide output path for ifcpatch without output #4721
This commit is contained in:
@@ -105,7 +105,8 @@ class ExecuteIfcPatch(bpy.types.Operator):
|
||||
"log": os.path.join(context.scene.BIMProperties.data_dir, "process.log"),
|
||||
}
|
||||
)
|
||||
ifcpatch.write(output, ifc_patch_output)
|
||||
if tool.Patch.does_patch_has_output(props.ifc_patch_recipes):
|
||||
ifcpatch.write(output, ifc_patch_output)
|
||||
self.report({"INFO"}, f"{props.ifc_patch_recipes} patch executed successfully")
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -50,9 +50,10 @@ class BIM_PT_patch(bpy.types.Panel):
|
||||
row.prop(props, "ifc_patch_input")
|
||||
row.operator("bim.select_ifc_patch_input", icon="FILE_FOLDER", text="")
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.prop(props, "ifc_patch_output")
|
||||
row.operator("bim.select_ifc_patch_output", icon="FILE_FOLDER", text="")
|
||||
if tool.Patch.does_patch_has_output(props.ifc_patch_recipes):
|
||||
row = layout.row(align=True)
|
||||
row.prop(props, "ifc_patch_output")
|
||||
row.operator("bim.select_ifc_patch_output", icon="FILE_FOLDER", text="")
|
||||
|
||||
if props.ifc_patch_args_attr:
|
||||
draw_attributes(props.ifc_patch_args_attr, layout)
|
||||
|
||||
@@ -36,3 +36,7 @@ class Patch(bonsai.core.tool.Patch):
|
||||
# Should mark them as such in the patches documentation
|
||||
# and process it later.
|
||||
return recipe == "SplitByBuildingStorey" and arg_name == "output_dir"
|
||||
|
||||
@classmethod
|
||||
def does_patch_has_output(cls, recipe: str) -> bool:
|
||||
return recipe != "SplitByBuildingStorey"
|
||||
|
||||
Reference in New Issue
Block a user