diff --git a/src/Mod/Fem/femcommands/commands.py b/src/Mod/Fem/femcommands/commands.py index b2f6f7ea453a..38998f99ae29 100644 --- a/src/Mod/Fem/femcommands/commands.py +++ b/src/Mod/Fem/femcommands/commands.py @@ -893,7 +893,7 @@ def __init__(self): self.tooltip = Qt.QT_TRANSLATE_NOOP( "FEM_ResultsPurge", "Purges all results from active analysis" ) - self.is_active = "with_results" + self.is_active = "with_analysis" def Activated(self): import femresult.resulttools as resulttools diff --git a/src/Mod/Fem/femresult/resulttools.py b/src/Mod/Fem/femresult/resulttools.py index 2afdf36e3cf4..a0e7362c1377 100644 --- a/src/Mod/Fem/femresult/resulttools.py +++ b/src/Mod/Fem/femresult/resulttools.py @@ -43,7 +43,7 @@ def purge_results(analysis): analysis group as a container for all objects needed for the analysis """ - # if analysis typ check is used result mesh + # if analysis type check is used, result mesh # without result obj is created in the analysis # we could run into trouble in one loop because # we will delete objects and try to access them later @@ -62,9 +62,19 @@ def purge_results(analysis): analysis.Document.removeObject(m.Name) analysis.Document.recompute() - # dat text object + # text object for m in analysis.Group: - if is_of_type(m, "App::TextDocument") and m.Name.startswith("ccx_dat_file"): + if is_of_type(m, "App::TextDocument"): + analysis.Document.removeObject(m.Name) + analysis.Document.recompute() + + # result pipeline and filter + for m in analysis.Group: + if is_of_type(m, "Fem::FemPostPipeline"): + # delete associated filters + for filter_obj in m.Filter: + analysis.Document.removeObject(filter_obj.Name) + # delete the pipeline itself analysis.Document.removeObject(m.Name) analysis.Document.recompute()