hexagon logo

Get Material ID from Element ID

Please suggest an API to get the material ID (24) from the element ID (168126)
 
Attached the sample PCOMPG screenshot.
 
Elements_Material
Parents
  • Hi,
    how you will create the input and use the data will to some extent govern how you would write this. Also the limits on the type of data you want to handle will also give things you must check e.g. your example has a unique material id (24) used for every laminate ply material - layers 1 to 9. In reality each layer could be a different material so how would you handle this.
    In the attached I took some code I had for a similar type of query and quickly modified it to do the type of thing you were asking for. Hopefully it will give you some insight to what is required. This handles multiple ply materials.
    !!Input this PCL function in Patran.
    declare:
    STRING el_list[virtual]
    INTEGER num_elements , max_plys, out_ids(virtual)
    STRING ply_mats[32](virtual)
     
    and call the function:
    ajh_pcomp_ply_mats(el_list, num_elements, out_ids, max_plys, ply_mats)
     

    Attached Files (1)
Reply
  • Hi,
    how you will create the input and use the data will to some extent govern how you would write this. Also the limits on the type of data you want to handle will also give things you must check e.g. your example has a unique material id (24) used for every laminate ply material - layers 1 to 9. In reality each layer could be a different material so how would you handle this.
    In the attached I took some code I had for a similar type of query and quickly modified it to do the type of thing you were asking for. Hopefully it will give you some insight to what is required. This handles multiple ply materials.
    !!Input this PCL function in Patran.
    declare:
    STRING el_list[virtual]
    INTEGER num_elements , max_plys, out_ids(virtual)
    STRING ply_mats[32](virtual)
     
    and call the function:
    ajh_pcomp_ply_mats(el_list, num_elements, out_ids, max_plys, ply_mats)
     

    Attached Files (1)
Children
No Data