FEM: mesh gmsh object, move make def into make objects FEM module

This commit is contained in:
Bernd Hahnebach 2017-02-20 18:01:46 +01:00 committed by wmayer
parent 907a14d73a
commit c5008f90d7
5 changed files with 13 additions and 47 deletions

View File

@ -126,7 +126,6 @@ SET(FemScripts_SRCS
FemInputWriterCcx.py
FemInputWriterZ88.py
FemMesh2Mesh.py
FemMeshGmsh.py
FemMeshGroup.py
FemMeshRegion.py
FemMeshTools.py

View File

@ -45,7 +45,6 @@ INSTALL(
_CommandAnalysis.py
FemMeshGmsh.py
_FemMeshGmsh.py
_ViewProviderFemMeshGmsh.py
_CommandMeshGmshFromShape.py

View File

@ -1,43 +0,0 @@
# ***************************************************************************
# * *
# * Copyright (c) 2016 - Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * 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
# @}

View File

@ -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()

View File

@ -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")