Skip to content

Commit

Permalink
FEM: small code change to get lgtm quit
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Nov 26, 2020
1 parent f2bf17e commit c6faecd
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/Mod/Fem/femtaskpanels/task_mesh_gmsh.py
Expand Up @@ -222,20 +222,22 @@ def run_gmsh(self):
QApplication.restoreOverrideCursor()

def get_active_analysis(self):
self.analysis = FemGui.getActiveAnalysis()
if self.analysis:
for m in FemGui.getActiveAnalysis().Group:
analysis = FemGui.getActiveAnalysis()
if not analysis:
FreeCAD.Console.PrintLog("No active analysis, means no group meshing.\n")
self.analysis = None # no group meshing
else:
for m in analysis.Group:
if m.Name == self.mesh_obj.Name:
FreeCAD.Console.PrintMessage(
"Active analysis found: {}\n"
.format(self.analysis.Name)
)
return
self.analysis = analysis # group meshing
break
else:
FreeCAD.Console.PrintLog(
"Mesh is not member of active analysis, means no group meshing.\n"
)
self.analysis = None # no group meshing
else:
FreeCAD.Console.PrintLog("No active analysis, means no group meshing.\n")
self.analysis = None # no group meshing
return

0 comments on commit c6faecd

Please sign in to comment.