AssignData Condition

Moderator: GiD Team

gonzaloalen
Posts: 2
Joined: Tue Oct 15, 2019 8:27 am

AssignData Condition

Postby gonzaloalen » Tue Oct 15, 2019 11:24 am

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
User avatar
escolano
Posts: 1580
Joined: Thu Sep 18, 2014 3:31 pm

Re: AssignData Condition

Postby escolano » Tue Oct 15, 2019 2:20 pm

This is a Tcl language rule, { } prevent substitution of variables, to allow substitution you can use " " or better [list ] 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

Return to “Mesh”

Who is online

Users browsing this forum: No registered users and 3 guests