diff --git a/src/Mod/Fem/App/CMakeLists.txt b/src/Mod/Fem/App/CMakeLists.txt index 6017f2143..8a3d2b295 100644 --- a/src/Mod/Fem/App/CMakeLists.txt +++ b/src/Mod/Fem/App/CMakeLists.txt @@ -126,7 +126,6 @@ SET(FemScripts_SRCS FemInputWriterCcx.py FemInputWriterZ88.py FemMesh2Mesh.py - FemMeshGmsh.py FemMeshGroup.py FemMeshRegion.py FemMeshTools.py diff --git a/src/Mod/Fem/CMakeLists.txt b/src/Mod/Fem/CMakeLists.txt index 372b94b27..1dbe226a3 100755 --- a/src/Mod/Fem/CMakeLists.txt +++ b/src/Mod/Fem/CMakeLists.txt @@ -45,7 +45,6 @@ INSTALL( _CommandAnalysis.py - FemMeshGmsh.py _FemMeshGmsh.py _ViewProviderFemMeshGmsh.py _CommandMeshGmshFromShape.py diff --git a/src/Mod/Fem/FemMeshGmsh.py b/src/Mod/Fem/FemMeshGmsh.py deleted file mode 100644 index fbc98684a..000000000 --- a/src/Mod/Fem/FemMeshGmsh.py +++ /dev/null @@ -1,43 +0,0 @@ -# *************************************************************************** -# * * -# * Copyright (c) 2016 - Bernd Hahnebach * -# * * -# * This program is free software; you can redistribute it and/or modify * -# * it under the terms of the GNU Lesser General Public License (LGPL) * -# * as published by the Free Software Foundation; either version 2 of * -# * the License, or (at your option) any later version. * -# * for detail see the LICENCE text file. * -# * * -# * This program is distributed in the hope that it will be useful, * -# * but WITHOUT ANY WARRANTY; without even the implied warranty of * -# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -# * GNU Library General Public License for more details. * -# * * -# * You should have received a copy of the GNU Library General Public * -# * License along with this program; if not, write to the Free Software * -# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * -# * USA * -# * * -# *************************************************************************** - -__title__ = "FemMeshGmsh" -__author__ = "Bernd Hahnebach" -__url__ = "http://www.freecadweb.org" - -## \addtogroup FEM -# @{ - -import FreeCAD -import _FemMeshGmsh - - -def makeFemMeshGmsh(name="FEMMeshGMSH"): - '''makeFemMeshGmsh(name): makes a GMSH FEM mesh object''' - obj = FreeCAD.ActiveDocument.addObject("Fem::FemMeshObjectPython", name) - _FemMeshGmsh._FemMeshGmsh(obj) - if FreeCAD.GuiUp: - import _ViewProviderFemMeshGmsh - _ViewProviderFemMeshGmsh._ViewProviderFemMeshGmsh(obj.ViewObject) - return obj - -# @} diff --git a/src/Mod/Fem/ObjectsFem.py b/src/Mod/Fem/ObjectsFem.py index 76e5d148d..e8477879b 100644 --- a/src/Mod/Fem/ObjectsFem.py +++ b/src/Mod/Fem/ObjectsFem.py @@ -249,6 +249,17 @@ def makeMeshShapeNetgenObject(name): return obj +def makeMeshGmsh(name="FEMMeshGMSH"): + '''makeMeshGmsh(name): makes a GMSH FEM mesh object''' + obj = FreeCAD.ActiveDocument.addObject("Fem::FemMeshObjectPython", name) + import _FemMeshGmsh + _FemMeshGmsh._FemMeshGmsh(obj) + if FreeCAD.GuiUp: + import _ViewProviderFemMeshGmsh + _ViewProviderFemMeshGmsh._ViewProviderFemMeshGmsh(obj.ViewObject) + return obj + + ''' # print supportedTypes App.newDocument() diff --git a/src/Mod/Fem/_CommandMeshGmshFromShape.py b/src/Mod/Fem/_CommandMeshGmshFromShape.py index a11ce896a..6aaf6129f 100644 --- a/src/Mod/Fem/_CommandMeshGmshFromShape.py +++ b/src/Mod/Fem/_CommandMeshGmshFromShape.py @@ -50,8 +50,8 @@ class _CommandMeshGmshFromShape(FemCommands): if (len(sel) == 1): if(sel[0].isDerivedFrom("Part::Feature")): mesh_obj_name = sel[0].Name + "_Mesh" - FreeCADGui.addModule("FemMeshGmsh") - FreeCADGui.doCommand("FemMeshGmsh.makeFemMeshGmsh('" + mesh_obj_name + "')") + FreeCADGui.addModule("ObjectsFem") + FreeCADGui.doCommand("ObjectsFem.makeMeshGmsh('" + mesh_obj_name + "')") FreeCADGui.doCommand("App.ActiveDocument.ActiveObject.Part = App.ActiveDocument." + sel[0].Name) if FemGui.getActiveAnalysis(): FreeCADGui.addModule("FemGui")