FEM Tutorial Python

Introduction
This example is meant to show how a simple Finite Element Analysis (FEA) in FreeCADs FEM Module is done by python. The model from FEM_CalculiX_Cantilever_3D will be taken for this example.



Requirements

 * FreeCAD version = 0.17.8400 or above.
 * This could be checked at the menu Help --> about FreeCAD.
 * Al thought due to the continuing changes in FEM module it is recommended to use the latest development snapshot of FreeCAD for python scripted FEM analysis's.
 * A set up FEM module. Check FEM_CalculiX_Cantilever_3D

Run the analysis
import FemGui FemGui.setActiveAnalysis(FreeCAD.ActiveDocument.Analysis) import FemToolsCcx fea = FemToolsCcx.FemToolsCcx fea.update_objects message = fea.check_prerequisites if not message: fea.reset_all fea.run fea.load_results else: FreeCAD.Console.PrintError("Houston, we have a problem! {}\n".format(message)) # in report view print("Houston, we have a problem! {}\n".format(message)) # in python console
 * 1) run the analysis

Appendix
Have Fun!