FEM: shell thickness object, move make def into make objects FEM module

This commit is contained in:
Bernd Hahnebach 2017-02-20 17:51:06 +01:00 committed by wmayer
parent b7111c3fa8
commit 6ffbac3e6b
5 changed files with 14 additions and 48 deletions

View File

@ -133,7 +133,6 @@ SET(FemScripts_SRCS
FemMeshGroup.py
FemMeshRegion.py
FemMeshTools.py
FemShellThickness.py
FemSolverCalculix.py
FemSolverZ88.py
FemTools.py

View File

@ -78,7 +78,6 @@ INSTALL(
_TaskPanelFemBeamSection.py
TaskPanelFemBeamSection.ui
FemShellThickness.py
_FemShellThickness.py
_ViewProviderFemShellThickness.py
_CommandShellThickness.py

View File

@ -1,44 +0,0 @@
# ***************************************************************************
# * *
# * Copyright (c) 2015 - 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__ = "FemShellThickness"
__author__ = "Bernd Hahnebach"
__url__ = "http://www.freecadweb.org"
## \addtogroup FEM
# @{
import FreeCAD
import _FemShellThickness
def makeFemShellThickness(thickness=20.0, name="ShellThickness"):
'''makeFemShellThickness([thickness], [name]): creates an shellthickness object to define a plate thickness'''
obj = FreeCAD.ActiveDocument.addObject("Fem::FeaturePython", name)
_FemShellThickness._FemShellThickness(obj)
obj.Thickness = thickness
if FreeCAD.GuiUp:
import _ViewProviderFemShellThickness
_ViewProviderFemShellThickness._ViewProviderFemShellThickness(obj.ViewObject)
return obj
# @}

View File

@ -60,6 +60,18 @@ def makeBeamSection(sectiontype='Rectangular', width=10.0, height=25.0, name="Be
return obj
def makeShellThickness(thickness=20.0, name="ShellThickness"):
'''makeShellThickness([thickness], [name]): creates an shellthickness object to define a plate thickness'''
obj = FreeCAD.ActiveDocument.addObject("Fem::FeaturePython", name)
import _FemShellThickness
_FemShellThickness._FemShellThickness(obj)
obj.Thickness = thickness
if FreeCAD.GuiUp:
import _ViewProviderFemShellThickness
_ViewProviderFemShellThickness._ViewProviderFemShellThickness(obj.ViewObject)
return obj
########## constraints ##########
def makeConstraintBearing(name):
'''makeConstraintBearing(name): makes a Fem ConstraintBearing object'''

View File

@ -45,8 +45,8 @@ class _CommandShellThickness(FemCommands):
def Activated(self):
FreeCAD.ActiveDocument.openTransaction("Create FemShellThickness")
FreeCADGui.addModule("FemShellThickness")
FreeCADGui.doCommand("FemGui.getActiveAnalysis().Member = FemGui.getActiveAnalysis().Member + [FemShellThickness.makeFemShellThickness()]")
FreeCADGui.addModule("ObjectsFem")
FreeCADGui.doCommand("FemGui.getActiveAnalysis().Member = FemGui.getActiveAnalysis().Member + [ObjectsFem.makeShellThickness()]")
FreeCADGui.addCommand('Fem_ShellThickness', _CommandShellThickness())