Hello,
I'm trying to assign conditions to entities, through Tcl code, with a command as follows:
set cn_elem 45
GiD_AssignData condition Losses_Model body_elements {0 0 0 0 $cn_elem 0 0 0 0 0 0 0 0} all
However Gid assigns a value "$cn_elem" in the condition (not 45), which is the sintax of the GiD Proccess command to assign a condition with a variable?
Thank you in advance,
Gonzalo
AssignData Condition
Moderator: GiD Team
Re: AssignData Condition
This is a Tcl language rule, { } prevent substitution of variables, to allow substitution you can use " " or better
- to preserve the amount of arguments, independently on the variable content (e.g. if it has spaces)
GiD_AssignData condition Losses_Model body_elements "0 0 0 0 $cn_elem 0 0 0 0 0 0 0 0" all
or better
GiD_AssignData condition Losses_Model body_elements [list 0 0 0 0 $cn_elem 0 0 0 0 0 0 0 0] all
Have a look to these Tcl rules: https://wiki.tcl-lang.org/page/Dodekalogue