Tcl code to get components id list from part id/name?

Sandeep Kumar Mahto
Sandeep Kumar Mahto Altair Community Member

Hello Team
I am working on script for mass balancing, through part selection. if i will get component list of respective part then I can create material with new density and can assign to respective property.
need tcl code that can give component list after part selection.

i worked at component level already but need on part level.

Thanks and regards
Sandeep

Tagged:

Welcome!

It looks like you're new here. Sign in or register to get started.

Best Answer

  • Michael Herve
    Michael Herve
    Altair Employee
    Answer ✓

    Hello again,

    from a part, you should at least be able to get the list of components:

    set CompList [hm_getvalue module name=part_name dataname=HW_CID]

    Depending on the solver, you may also be able to get directly the property and/or material:

    set PropList [hm_getvalue module name=part_name dataname=HW_PID]

    set MatList [hm_getvalue module name=part_name dataname=HW_MID]

    Hope that helps,

    Michael

Answers

  • Michael Herve
    Michael Herve
    Altair Employee

    Hello @Sandeep Kumar Mahto ,

    For mass balancing, please note we introduced in version 2024.1 a Mass Balancing tool, which allow to generate non-structural mass:

    Could that help?

    Best Regards,

    Michael

  • Sandeep Kumar Mahto
    Sandeep Kumar Mahto Altair Community Member

    Hello @Michael Herve_21439

    thank for response.
    before NSM, we do mass balancing at part level first by changing density. after that we go for NSM.

    Thanks and Regards
    Sanddep

  • Michael Herve
    Michael Herve
    Altair Employee
    Answer ✓

    Hello again,

    from a part, you should at least be able to get the list of components:

    set CompList [hm_getvalue module name=part_name dataname=HW_CID]

    Depending on the solver, you may also be able to get directly the property and/or material:

    set PropList [hm_getvalue module name=part_name dataname=HW_PID]

    set MatList [hm_getvalue module name=part_name dataname=HW_MID]

    Hope that helps,

    Michael

  • Sandeep Kumar Mahto
    Sandeep Kumar Mahto Altair Community Member

    Hello @Michael Herve_21439
    Thank you so much, It is working.

    Thanks and Regards
    Sandeep

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.