🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

How to Extract the component name from selecting node / element.

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

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

Find more posts tagged with

Sort by:
1 - 5 of 51
    User: "tinh"
    Altair Community Member
    Updated by tinh

    Hello

    try hm_getentityvalue nodes nodeid collector.name 1 -byid

     

    please read topic about 'data names' in hypermesh help

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    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

    User: "tinh"
    Altair Community Member
    Updated by tinh

    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'

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    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

    User: "tinh"
    Altair Community Member
    Updated by tinh

    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]}