Hi
I want to runt the Tcl command with argument, For example in the tcl file i defined
proc GetElement { elemtype, i } {
set e [GiD_Info Mesh Elements $elemtype $i $i]
return $e
}
in the bas file I called
*tcl(GetElement Hexahedra 1)
But it doesn't work, nor
*set var et=Hexahedra
*tcl(GetElement *et 1)
What is the calling syntax of tcl command in this case?
running tcl command
Moderator: GiD Team
Re: running tcl command
In the .bas side both your syntax are ok, use the simplest one
but the arguments of a Tcl procedure must be separed by spaces, without the comma!!
instead of
proc GetElement { elemtype, i } {
set e [GiD_Info Mesh Elements $elemtype $i $i]
return $e
}
must be
proc GetElement { elemtype i } {
set e [GiD_Info Mesh Elements $elemtype $i $i]
return $e
}
You can see here a tutorial about the standart Tcl scripting language: https://www.tcl.tk/man/tcl8.5/tutorial/tcltutorial.html
but the arguments of a Tcl procedure must be separed by spaces, without the comma!!
instead of
proc GetElement { elemtype, i } {
set e [GiD_Info Mesh Elements $elemtype $i $i]
return $e
}
must be
proc GetElement { elemtype i } {
set e [GiD_Info Mesh Elements $elemtype $i $i]
return $e
}
You can see here a tutorial about the standart Tcl scripting language: https://www.tcl.tk/man/tcl8.5/tutorial/tcltutorial.html
Re: running tcl command
Thanks, now I'm clear on it.