From a6df94e37fb4f6595b4674600c22a2e31a56e0a0 Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Sun, 26 Jul 2020 23:39:27 +0200 Subject: [PATCH] FEM: show result, make it possible to use the menu and icon if there is a pure result object in a document. --- src/Mod/Fem/femcommands/manager.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Mod/Fem/femcommands/manager.py b/src/Mod/Fem/femcommands/manager.py index 6b6c2b9066..05ac286c40 100644 --- a/src/Mod/Fem/femcommands/manager.py +++ b/src/Mod/Fem/femcommands/manager.py @@ -87,8 +87,8 @@ class CommandManager(object): ) elif self.is_active == "with_selresult": active = ( - FemGui.getActiveAnalysis() is not None - and self.active_analysis_in_active_doc() + # on import of Frd file in a empty document not Analysis will be there + FreeCADGui.ActiveDocument is not None and self.result_selected() ) elif self.is_active == "with_part_feature": @@ -173,10 +173,8 @@ class CommandManager(object): def result_selected(self): sel = FreeCADGui.Selection.getSelection() if len(sel) == 1 and sel[0].isDerivedFrom("Fem::FemResultObject"): - for o in FemGui.getActiveAnalysis().Group: - if o == sel[0]: - self.selobj = o - return True + self.selobj = sel[0] + return True return False def part_feature_selected(self):