How Can I get the Solver Keywords with Hypermesh Tcl Script?

Jason_21458
Jason_21458 Altair Community Member
edited May 22 in Community Q&A

Hi Altair,

I want to get the keywords list after I import the model into Hypermesh with Tcl scripts, because I found some strange keywords exist in my model. 

I didn't find the relative scripts in hyperworks help web.

I found only  "set keyword [hm_getvalue $entType id=$Id dataname=solverkeyword]" from the help document. But it's inconvenient.

I thought there must have a code to get all keywords list out.

Could you give me the feedback?

Thanks!

Answers

  • Ben Buchanan
    Ben Buchanan
    Altair Employee
    edited July 2022

    The following isn't great because it could take a long time if you have many elements but it does get you what you want.

    hm_createmark elements 1 "advanced" "all"
    set keywordList [lsort -unique [hm_getvalue element mark=1 dataname=solverkeyword]]

     

  • Jason_21458
    Jason_21458 Altair Community Member
    edited July 2022

    The following isn't great because it could take a long time if you have many elements but it does get you what you want.

    hm_createmark elements 1 "advanced" "all"
    set keywordList [lsort -unique [hm_getvalue element mark=1 dataname=solverkeyword]]

     

    Hi Buchanan,

    Thank you for your quickly reply, but I'm not only want to get elements keyword. I want get all solver keywords like parts, sets, sections, mats and etc. 

    When Hypermesh parse the model, it mush have read the and stored the keywords in some place.

  • Ben Buchanan
    Ben Buchanan
    Altair Employee
    edited July 2022

    Hi Buchanan,

    Thank you for your quickly reply, but I'm not only want to get elements keyword. I want get all solver keywords like parts, sets, sections, mats and etc. 

    When Hypermesh parse the model, it mush have read the and stored the keywords in some place.

    You should be able to loop through the other entity types something like this:

    hm_createmark $entityType 1 "advanced" "all"
    set keywordList [lsort -unique [hm_getvalue $entityType mark=1 dataname=solverkeyword]]

    but Yes I agree, seems like there should be an easier way but I couldn't find it either.

  • Akash Purushothaman
    Akash Purushothaman Altair Community Member
    edited May 22

    is there an equivalent code for hypermesh 2019??

    the dataname solverkeyword is not available in 2019

    I use hm_getvalue sets id=1 dataname=solverkeyword
    this works for versions 2021 and above.. but not for 2019. so is there a code to get solver keyword for sets?