Struggle with placing element in set with tcl sript

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

Hi everyone 

 

I've got some struggle using the hypermesh script to get some elements in a set for postprocessing these elements. In fact i'm abble to get the elements i want in the mark 1 but then it's impossible to get these elements in the set. The amounth of elements is quite big but i'm abble to place these elements manually in the set but it dont work with the function :

 

 *setvalue sets id=4 ids=elems={ [hm_getmark elems 1] }

 

Does someone know some specificity about this function ?

 

Thanks for the help

 

Tagged:

Answers

  • tinh
    tinh Altair Community Member
    edited November 2017

    hi,

    Try replacing { } by ' '

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2017

    hi 

     

    well that doesn't work neither ..

     

    When I select the 0 under the line of code this is writen in a pop up :

     

    while executing
    '*setvalue sets id=4 ids=elems='[hm_getmark elems 1]''
        ('uplevel' body line 1)
        invoked from within
    'uplevel #0 {*setvalue sets id=4 ids=elems='[hm_getmark elems 1]'}'
        invoked from within
    'interp eval $::tkcon::OPT(exec) $args'
        (procedure '::tkcon::EvalSlave' line 2)
        invoked from within
    'EvalAttached $cmd'
     

    I don't know what that says i can't understand this kind of language 

  • tinh
    tinh Altair Community Member
    edited November 2017

    are you sure syntax is ... ids=elems='[... ?

    or just ...ids='[...  ?

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2017

    I tried many things and i'm very struggleling with the syntax but i think that the amounth of elements is way too big for being transfered from a mark to a set ( i talking about 20 000 element) so i begin to think that the problem is linked to the use of a mark for this amounth of data. I'm thinking about using a list or a table for these data but then i don't know how to feed the *setvalue with that kind of variable.

     

    Thanks for your help tinh 

  • tinh
    tinh Altair Community Member
    edited November 2017

    the syntax must be

    *setvalue sets id=4 ids='elems [hm_getmark elems 1]'

     

    if it is failed, try {i prefer this way}

    *entitysetupdate nameofset elems 1

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2017

    Man thank you so much ! The *entityupdate works !

     

    I've been trying for two days with this single line of command haha