How to Extract the component name from selecting node / element.
hi there,
i am trying to resolve the problem of extracting the component name.
1) if i am selecting the node / element.
2) then how to identified that which component name is that nodes / element is belongs too.
please resolve this issue.
Regards
Adams
Answers
-
Hello
try hm_getentityvalue nodes nodeid collector.name 1 -byid
please read topic about 'data names' in hypermesh help
0 -
hi tinh,
set a [hm_getmark nodes [*createmarkpanel nodes 1]];
'set b [hm_getentityvalue nodes $a 'collector.name' 1 -byid] '
puts 'col name : $b'
it is not returning the name of the collector.
Regards
Adams
0 -
Hello Adams
it should be:
*createmarkpanel nodes 1 'Select a node';#this is an interactive command
set a [hm_getmark nodes 1]
set b [hm_getentityvalue nodes $a collector.name 1 -byid]; #if you did not or selected more than one node, this command will raise an error
puts 'col name: $b'
0 -
Hi tinh,
with the code listed above i am not able to retrieve the name of the component.
but when i am taking element as an entity then component name is extracted.
in my problem set node is important, i want to extract the component name while selecting node only.
thanks
Adams
0 -
oh,sorry i forgot that one node can be belonged to 2 or more than 2 comps
so if you have a node, first find elements attached to it
*createmark nodes 1 $nodeid
*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]}
0