Skip to content

Commit

Permalink
FEM: reinforced material, add a GUI command
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Jun 16, 2019
1 parent f162da6 commit 264d5e9
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Mod/Fem/Gui/Workbench.cpp
Expand Up @@ -87,6 +87,7 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
<< "FEM_MaterialSolid"
<< "FEM_MaterialFluid"
<< "FEM_MaterialMechanicalNonlinear"
<< "FEM_MaterialReinforced"
<< "FEM_MaterialEditor"
<< "Separator"
<< "FEM_ElementGeometry1D"
Expand Down Expand Up @@ -190,6 +191,7 @@ Gui::MenuItem* Workbench::setupMenuBar() const
*material << "FEM_MaterialSolid"
<< "FEM_MaterialFluid"
<< "FEM_MaterialMechanicalNonlinear"
<< "FEM_MaterialReinforced"
<< "FEM_MaterialEditor";

Gui::MenuItem* elec = new Gui::MenuItem;
Expand Down
35 changes: 35 additions & 0 deletions src/Mod/Fem/femcommands/commands.py
Expand Up @@ -665,6 +665,37 @@ def Activated(self):
FreeCAD.ActiveDocument.recompute()


class _CommandFemMaterialReinforced(CommandManager):
"The FEM_MaterialReinforced command definition"
def __init__(self):
super(_CommandFemMaterialReinforced, self).__init__()
self.resources = {
'Pixmap': 'fem-material-reinforced',
'MenuText': QtCore.QT_TRANSLATE_NOOP(
"FEM_MaterialReinforced",
"Reinforced material (concrete)"
),
'Accel': "M, M",
'ToolTip': QtCore.QT_TRANSLATE_NOOP(
"FEM_MaterialReinforced",
"Creates a material for reinforced matrix material such as concrete"
)
}
self.is_active = 'with_analysis'

def Activated(self):
FreeCAD.ActiveDocument.openTransaction("Create Reinforced Material")
FreeCADGui.addModule("ObjectsFem")
FreeCADGui.doCommand(
"FemGui.getActiveAnalysis().addObject(ObjectsFem."
"makeMaterialReinforced(FreeCAD.ActiveDocument, 'ReinforcedMaterial'))"
)
FreeCADGui.doCommand(
"FreeCADGui.ActiveDocument.setEdit(FreeCAD.ActiveDocument.ActiveObject.Name)"
)
FreeCAD.ActiveDocument.recompute()


class _CommandFemMaterialSolid(CommandManager):
"The FEM_MaterialSolid command definition"
def __init__(self):
Expand Down Expand Up @@ -1296,6 +1327,10 @@ def Activated(self):
'FEM_MaterialMechanicalNonlinear',
_CommandFemMaterialMechanicalNonlinear()
)
FreeCADGui.addCommand(
'FEM_MaterialReinforced',
_CommandFemMaterialReinforced()
)
FreeCADGui.addCommand(
'FEM_MaterialSolid',
_CommandFemMaterialSolid()
Expand Down

0 comments on commit 264d5e9

Please sign in to comment.