How to extract MISO curves of a material in Mechanical using Mechanical scripting?

Rohith Patchigolla
Rohith Patchigolla Member, Moderator, Employee Posts: 193
100 Comments 25 Answers Second Anniversary 25 Likes
✭✭✭✭

How to extract MISO curves of a material in Mechanical using Mechanical scripting?

Answers

  • Rohith Patchigolla
    Rohith Patchigolla Member, Moderator, Employee Posts: 193
    100 Comments 25 Answers Second Anniversary 25 Likes
    ✭✭✭✭

    The below code loops over each body and prints MISO data defined for the material corresponding to the body.

    import materials
    bodies = ExtAPI.DataModel.Project.Model.GetChildren(DataModelObjectCategory.Body,True) # create list with all bodies in the Mechanical tree
    for body in bodies: #  loop on all bodies in Mechanical Tree
        print(body.Name) #  print body name
        geo_body = body.GetGeoBody() #  get GeoData of this current body
        material = geo_body.Material #  access material class for this geo body
        print(materials.GetListMaterialProperties(material)) #  print material properties defined for this body
        properties = materials.GetMaterialPropertyByName(material,"Isotropic Hardening") #  list values for property selected
        print(properties) # print values