HyperMesh: Get list of collectors
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
-
*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"
}
1
Answers
-
*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"
}
1 -
Adriano A. Koga_21884 said:
*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'
0 -
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.
0