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,
    this is an idea of the structure to get the data with pcl.
    note for a single element it has quite a lot of work to do so if called in a big loop one element at a time it is inefficient. However your process can probably be worked with multiple elements/regions etc to minimise the db calls and have fewer larger ones. Or maybe process all laminate data to temporary store the data and then release the storage when you've finished.
    best regards
    Arthur
     
         db_get_region_for_elements
         db_get_region_definition
         db_get_material   
     $ if it is a laminate composite get all the layer materials
         db_get_matl_prop_value_count
     $      size arrays: material word ids,values,fieldids,fieldnames 
           db_get_matl_prop_value
     $ loop over material word ids to find "number of plies" id
     $ get number of plies from the corresponding material word values
     $  size arrays for ply materials,thicknesses,orientations
             db_get_comp_lam_ids_by_id
     $ loop over the ply materials getting their data 
              db_get_material
Reply
  • Hi,
    this is an idea of the structure to get the data with pcl.
    note for a single element it has quite a lot of work to do so if called in a big loop one element at a time it is inefficient. However your process can probably be worked with multiple elements/regions etc to minimise the db calls and have fewer larger ones. Or maybe process all laminate data to temporary store the data and then release the storage when you've finished.
    best regards
    Arthur
     
         db_get_region_for_elements
         db_get_region_definition
         db_get_material   
     $ if it is a laminate composite get all the layer materials
         db_get_matl_prop_value_count
     $      size arrays: material word ids,values,fieldids,fieldnames 
           db_get_matl_prop_value
     $ loop over material word ids to find "number of plies" id
     $ get number of plies from the corresponding material word values
     $  size arrays for ply materials,thicknesses,orientations
             db_get_comp_lam_ids_by_id
     $ loop over the ply materials getting their data 
              db_get_material
Children
No Data