Retrieving of Nodes.

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A
Hi all,

 

can anyone help me in retrieving the nodes when saved through 'lappend' command

 

command used:

 

set saved [hm_getmark nodes 1]

 

set nn [lappend nn $saved]

 

Result:

 

nn_layer = {251497 251498 251499 251500 251501 251502 251503 251504 251505 251506}, llength = 

 

1

nn_layer = {251497 251498 251499 251500 251501 251502 251503 251504 251505 251506} {253243 

 

253244 253245 253246 253247 253248 253249 253250 253251 253252}, llength = 2

 

i want to retrieved the all nodes but only two nodes are retrieved from different layer.

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited January 2014

    Hi there!

     

    use the following:

     


    set saved [hm_getmark nodes 1]
    set nn [lappend nn $saved]
    set nn [ join $nn ]
     
    foreach n $nn { puts $n}

     

    cheers!

     

    edit: just to explain what you where doing. You where appending a list o another list. Each of the items of your list was another list.

  • tinh
    tinh Altair Community Member
    edited January 2014

    Hi there

    alternatively using 'eval'

    set nn [eval lappend nn $saved]

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited January 2014

    Hi Cesar and Tinh,

     

    thanks for helping.

     

    now every node is acting as different entity and able to retrieve all at once when needed.

     

    ' set nn [ join $nn ] '

     

    thanks

    Adams.