diff --git a/src/Mod/CAM/Path/Main/Gui/SanityCmd.py b/src/Mod/CAM/Path/Main/Gui/SanityCmd.py index f5c79b9a14..b02defb403 100644 --- a/src/Mod/CAM/Path/Main/Gui/SanityCmd.py +++ b/src/Mod/CAM/Path/Main/Gui/SanityCmd.py @@ -65,13 +65,21 @@ class CommandCAMSanity: # Ask the user for a filename to save the report to + defaultDir = os.path.split(FreeCAD.ActiveDocument.getFileName())[0] + + if defaultDir == "": + defaultDir = os.path.expanduser("~") + file_location = QFileDialog.getSaveFileName( None, translate("Path", "Save Sanity Check Report"), - os.path.expanduser("~"), + defaultDir, "HTML files (*.html)", )[0] + if file_location == "": + return + sanity_checker = Sanity.CAMSanity(obj, file_location) html = sanity_checker.get_output_report()