• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Patran
  3. Get Material ID from Element ID

Following Cadence Design Systems’ acquisition of the Design & Engineering (D&E) business, the D&E Community Forum on the Nexus Community Center has been migrated in the Cadence Physical System Simulation Community. For more details and if you have any questions, please refer to the FAQ.

Stats

  • State Not Answered
  • Replies 3
  • Subscribers 3
  • Views 20
  • Members are here 0
More Content

Get Material ID from Element ID

Boobalan
Boobalan over 7 years ago
Please suggest an API to get the material ID (24) from the element ID (168126)
 
Attached the sample PCOMPG screenshot.
 
Elements_Material
  • Sign in to reply
  • Cancel
  • Arthur Hickson
    0 Arthur Hickson over 7 years ago
    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
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Boobalan
    0 Boobalan over 7 years ago
    Thanks Arthur and i need to do the same for 1000 elements. Is this optimised method?
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Arthur Hickson
    0 Arthur Hickson over 7 years ago
    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)
    ajh_pcomp_ply_mats.pcl.zip
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2026 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information