From 461e506c414d054d5784af557910d45853f8bed6 Mon Sep 17 00:00:00 2001 From: Przemo Firszt Date: Tue, 28 Jul 2015 17:02:16 +0100 Subject: [PATCH] FEM: Add command only when GUI is up Signed-off-by: Przemo Firszt --- src/Mod/Fem/MechanicalMaterial.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Mod/Fem/MechanicalMaterial.py b/src/Mod/Fem/MechanicalMaterial.py index e06177a35..2e639fa15 100644 --- a/src/Mod/Fem/MechanicalMaterial.py +++ b/src/Mod/Fem/MechanicalMaterial.py @@ -265,4 +265,5 @@ class _MechanicalMaterialTaskPanel: self.add_mat_dir(custom_mat_dir, ":/icons/user.svg") -FreeCADGui.addCommand('Fem_MechanicalMaterial', _CommandMechanicalMaterial()) +if FreeCAD.GuiUp: + FreeCADGui.addCommand('Fem_MechanicalMaterial', _CommandMechanicalMaterial())