How to get the material properties for defined element using Mechanical API or DPF?

dafedin
dafedin Member Posts: 12
Name Dropper First Comment
edited June 27 in Structures

Hello team,

I'm creating a script that gets the stress values in elements defined by element Id and would like to compare the stress values with the ultimate ones for material automatically. So, I wonder how to get the values of material properties for the element with a defined Id using Mechanical API or DPF?

Thanks

Answers

  • dafedin
    dafedin Member Posts: 12
    Name Dropper First Comment

    The following code:

    import mech_dpf
    import Ans.DataProcessing as dpf
    mech_dpf.setExtAPI(ExtAPI)
    dataSources = mech_dpf.GetDataSources(2)
    mat_op = dpf.operators.metadata.material_provider()
    mat_op.inputs.data_sources.Connect(dataSources)
    mats = mat_op.outputs.materials.GetData()
    

    bringing error:

    Could not find the specified Output Type.

    Why showed code doesn't work?