collector name based on node id
Hello,
i'm trying to get collector name based on node id with the following script.
set node(id) '
301388
210613
254295
151336
'
foreach index [array names node] {
puts '$node($index)'
*createmark nodes 1 $node($index)
*findmark nodes 1 1 1 elems 0 2
set elems [hm_getmark elems 2]
foreach elemid $elems {puts [hm_getentityvalue elems $elemid collector.name 1 -byid]}
}
issue: script outs collector name corresponding to last node (151336) only please help me.
Answers
-
Hi,
Your first foreach is wrong, considering you're only interested in node(id) you can give it directly.
foreach nodeID $node(id) {
puts $nodeID--nodeID
*createmark nodes 1 $nodeID
*findmark nodes 1 1 1 elems 0 2
set elems [hm_getmark elems 2]
puts $elems--elems;
foreach elemid $elems {puts [hm_getentityvalue elems $elemid collector.name 1 -byid]}
}0 -
instead of second for loop, you can use the below commands
*createmark elems 1 'by node' $node;
if {[hm_marklength elems 1]} {
set lst_Comps [eval hm_parentcomplist id [hm_getmark elems 1]];
}
0 -
Hello Mr. Livil, Mr. Sandeep,
Thank you 'it's working'.
Regards,
Anil.
0