sets

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

how come I loop through each nodes in set list

 

Answers

  • Roshan Shiveshwar
    Roshan Shiveshwar Altair Community Member
    edited July 2017

    This should work...

     

    hm_createmark nodes 1 'by set'  'Your set name'

     

    foreach node [hm_getmark nodes 1] {

       *** perform activity

     

    }

     

     

     

  • llyle_20499
    llyle_20499 New Altair Community Member
    edited July 2017

    Hello mahes,


    set $lst_nodes [hm_createmark nodes 'by set' setname

    foreach node $lst_nodes {
    puts $node
    }

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited July 2017

    Thanks Roshan and Livillyle

  • tinh
    tinh Altair Community Member
    edited July 2017

    Hello mahes,


    set $lst_nodes [hm_createmark nodes 'by set' setname

    foreach node $lst_nodes {
    puts $node
    }

     

    Hi, hm_createmark return an emptied string

    so to get lst_nodes you have to use hm_getmark;)/emoticons/default_wink.png' srcset='/emoticons/wink@2x.png 2x' title=';)' width='20' />

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited July 2017

    Hi tinh,

    Thanks tinh.

    Is using createmark is the reason i cant access the nodes in the list?

    And can u pls suggest me some url that will be useful for learning about basic things about hm commands like how they wrk ,wat it returns 

  • tinh
    tinh Altair Community Member
    edited July 2017

    Hi

    Use *createmark nodes 1 {*}$nodelist

    You can get command explaination in reference help (help>altair help home>reference>hypermesh)

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited July 2017

    Hi,

    Thanks tinh