🎉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

tcl - selecting all elements of a component

User: "Jan-Eric Seidel"
Altair Community Member
Updated by Jan-Eric Seidel

Hey

I'm making a tcl script and i want to create add elements to a set by a collector. normaly i would do elements -> by collector -> select collector.

but the command file just gives me:

*setvalue sets id=1 ids={elems 67376-70125}
*setvalue sets id=1 STATUS=0 5422=LIST
 
I don't want no name every element number. I want something like this:
 
*setvalue sets id=1 ids={#all elemets from my collector/component#}
*setvalue sets id=1 STATUS=0 5422=LIST  #and whatever has to be written here
 
thanks

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "Adriano_Koga"
    Altair Employee
    Accepted Answer
    Updated by Adriano_Koga

    you could create a list of elems first:

    I believe it would be something like this.

     

    set comp_ID 10;

    *createmark elems 1 "by comp id" $comp_ID; #select elements by comp (maybe by collector or comp name)

    set elems_list [hm_getmark elems 1]; #store in a list

    *clearmark elems 1

     

    eval "*setvalue sets id=1 ids=\{elems $elems_list\}" ; #write the command to a string and then 'eval' the resulting string

    *setvalue sets id=1 STATUS=0 5422=LIST

     

     

    somethng like this might work..sorry, i haven't tested it.