FEM: reinforced material, add a GUI command
This commit is contained in:
@@ -87,6 +87,7 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
|
||||
<< "FEM_MaterialSolid"
|
||||
<< "FEM_MaterialFluid"
|
||||
<< "FEM_MaterialMechanicalNonlinear"
|
||||
<< "FEM_MaterialReinforced"
|
||||
<< "FEM_MaterialEditor"
|
||||
<< "Separator"
|
||||
<< "FEM_ElementGeometry1D"
|
||||
@@ -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;
|
||||
|
||||
@@ -665,6 +665,37 @@ class _CommandFemMaterialMechanicalNonlinear(CommandManager):
|
||||
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):
|
||||
@@ -1296,6 +1327,10 @@ FreeCADGui.addCommand(
|
||||
'FEM_MaterialMechanicalNonlinear',
|
||||
_CommandFemMaterialMechanicalNonlinear()
|
||||
)
|
||||
FreeCADGui.addCommand(
|
||||
'FEM_MaterialReinforced',
|
||||
_CommandFemMaterialReinforced()
|
||||
)
|
||||
FreeCADGui.addCommand(
|
||||
'FEM_MaterialSolid',
|
||||
_CommandFemMaterialSolid()
|
||||
|
||||
Reference in New Issue
Block a user