Code: Select all
doc = FreeCAD.open(FreeCAD.ConfigGet("AppHomePath") + 'data/examples/FemCalculixCantilever3D.FCStd')
import FemGui
FemGui.setActiveAnalysis(doc.Analysis)
import femtools.ccxtools as tools
ft = tools.FemToolsCcx()
from femsolver.calculix.writer import FemInputWriterCcx as iw
fiwc = iw(
ft.analysis, ft.solver, ft.mesh, ft.materials_linear,
None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None
)
fiwc.get_material_elements()
elmat = []
for object in fiwc.material_objects:
E = object['Object'].Material['YoungsModulus']
Nu = object['Object'].Material['PoissonRatio']
for el in object['FEMElements']:
elmat.append([el, E, Nu])
print (elmat)