Query Young's Modulus, Poisson's ratio in Ansys profile

Roshan Shiveshwar
Roshan Shiveshwar Altair Community Member
edited October 2020 in Community Q&A

Hi ,

 

I am trying to query  Young's Moduls, Poisson's ratio of a material Ansys profile.

The following command doesn't seem to work - 

         set E [hm_getvalue materials id=$mat_id dataname=E];         set Nu [hm_getvalue materials id=$mat_id dataname=Nu];

 

I also tried the following

image.png.d2c003d16a153519666ae313d8f32f3b.png

 

Is there any way I can successfuly query all the attributes assigned to the material, irrespective of solver setings?

 

Thanks!

Tagged:

Answers

  • Q.Nguyen-Dai
    Q.Nguyen-Dai Altair Community Member
    edited February 2020

    Which 'Card image' do you use for your material?  If you use 'MATERIAL', you can try:

     

     hm_getvalue mat id=1 dataname=MP_EX_VAL2

     

  • tinh
    tinh Altair Community Member
    edited February 2020

    Hi

    Query attribute name by

    hm_attributelistall mats 3 name

  • Q.Nguyen-Dai
    Q.Nguyen-Dai Altair Community Member
    edited February 2020

    @tinh: on my 2019.1 Hypermesh, this command does not work. In the help I see:

     hm_attributelistall  Returns a list of all attribute IDs, names, types or type names for the current template.  Syntax : hm_attributelistall value  Type : HyperMesh Tcl Query  Description : Returns a list of all attribute IDs, names, types or type names for the current template. Inputs  value     The type of list to return. Valid values are:      id - the attribute ID      name - the attribute name      type - the attribute type number      typename - the attribute type string 

     

  • Roshan Shiveshwar
    Roshan Shiveshwar Altair Community Member
    edited February 2020

    @tinh: on my 2019.1 Hypermesh, this command does not work. In the help I see:

      hm_attributelistall  Returns a list of all attribute IDs, names, types or type names for the current template.  Syntax : hm_attributelistall value  Type : HyperMesh Tcl Query  Description : Returns a list of all attribute IDs, names, types or type names for the current template. Inputs  value     The type of list to return. Valid values are:      id - the attribute ID      name - the attribute name      type - the attribute type number      typename - the attribute type string

     

     

    I think he meant

     hm_attributelist mats 3 name

     

  • Roshan Shiveshwar
    Roshan Shiveshwar Altair Community Member
    edited February 2020

    Which 'Card image' do you use for your material?  If you use 'MATERIAL', you can try:

     

      hm_getvalue mat id=1 dataname=MP_EX_VAL2

     

     

    Thanks Q.Nguyen-Dai !

    If the profile was Abaqus, I believe I have to use the following:

     hm_getvalue mat id=1 dataname=Young

    Now, since I want to write a code which is profile independent, I am wondering if there is a generic query command. (Atleast for basic properties such as Density, Young's modulus, Poisson's ratio etc.)

     

  • tinh
    tinh Altair Community Member
    edited February 2020

    Yes, I am sorry for the mistake!

    I mean hm_attributelist mats 3 name

     

    @Roshan Shiveshwar if you want a generic way, you will have to filter tokens like E , young in attrib names

    As i see, attrib names of profiles are not same. That means you should store them in a dict. 

     

  • Roshan Shiveshwar
    Roshan Shiveshwar Altair Community Member
    edited February 2020

    Yes, I am sorry for the mistake!

    I mean hm_attributelist mats 3 name

     

    @Roshan Shiveshwar if you want a generic way, you will have to filter tokens like E , young in attrib names

    As i see, attrib names of profiles are not same. That means you should store them in a dict. 

     

    Yes. Even I felt the same. Create a custom library of required attrib names and use them as needed.