HyperMesh: Get list of collectors

mblock90
mblock90 Altair Community Member
edited July 2021 in Community Q&A

Hello everyone, 

I am attempting to query Hypermesh for a list of collectors (either Name or ID) so that I can loop through and perform actions on each individually. Is there any way to get this info? 

Thank you!

Best Answer

  • Adriano A. Koga
    Adriano A. Koga
    Altair Employee
    edited July 2021 Answer ✓

    *createmark loadcols 1 "all" ; #select all loadcols and add to mark #1

    set loadcols_list [hm_getmark loadcols 1] ; #store the selection from mark #1 to a list

    set loadcols_name [hm_getvalue loadcols user_ids=$loadcols_list dataname=name] ; #retrieves the list of names

     

    #foreach load collector, do something

    foreach loadcolo $loadcols_list loadcol_namo $loadcols_name {

          puts  "ID: $loadcolo         name: $loadcol_namo"

    }

Answers

  • Adriano A. Koga
    Adriano A. Koga
    Altair Employee
    edited July 2021 Answer ✓

    *createmark loadcols 1 "all" ; #select all loadcols and add to mark #1

    set loadcols_list [hm_getmark loadcols 1] ; #store the selection from mark #1 to a list

    set loadcols_name [hm_getvalue loadcols user_ids=$loadcols_list dataname=name] ; #retrieves the list of names

     

    #foreach load collector, do something

    foreach loadcolo $loadcols_list loadcol_namo $loadcols_name {

          puts  "ID: $loadcolo         name: $loadcol_namo"

    }

  • Adriano A. Koga
    Adriano A. Koga
    Altair Employee
    edited July 2021

    *createmark loadcols 1 "all" ; #select all loadcols and add to mark #1

    set loadcols_list [hm_getmark loadcols 1] ; #store the selection from mark #1 to a list

    set loadcols_name [hm_getvalue loadcols user_ids=$loadcols_list dataname=name] ; #retrieves the list of names

     

    #foreach load collector, do something

    foreach loadcolo $loadcols_list loadcol_namo $loadcols_name {

          puts  "ID: $loadcolo         name: $loadcol_namo"

    }

    sorry...just re-read the question, and you didn't ask load collector, but 'collector'.

    If it is component, this works the same, just change to 'comps' instead of 'loadcols'

  • mblock90
    mblock90 Altair Community Member
    edited July 2021

    Thank you for the quick reply. I will give that a shot!

    I had though of attempting to build the list via hm_getcollectorname ignoring any that return errors. But I am not sure if there is a maximum value for collector ID to have complete coverage.