[GiDlist] How to read the command line into a tcl variable?

Moderator: GiD Team

Post Reply
Andres Peratta

[GiDlist] How to read the command line into a tcl variable?

Post by Andres Peratta »

Hi
Is there a way to get the data left by the user in the command line at the
bottom of the screen from a tcl script ?
I would like to send a message to the user, such as for example:

GidUtils::SetWarnLine [_ "Enter the diameter ( default = %s )" $diam]

then wait for the user to type something in the command line, and then capture
it in a variable.

Apologies if this has been explained before. I could not find the answer
anywhere else.
Many thanks
Andres



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20101115/706e18e2/attachment.htm
User avatar
escolano
Posts: 1922
Joined: Sun Sep 05, 1982 10:51 pm

[GiDlist] How to read the command line into a tcl variable?

Post by escolano »

No, the data written in the command line is sent to the internal processor of words,

but you can open your own Tk window to collect your data, and after then send the appropiated GiD_Process commands to GiD

e.g. you can use our predefined tk_dialogEntryRAM to open a window to ask for example a positive real number, with somethin like this
(the global variable ::MyDiameter is used to provide to store the value and provide the default one)

if { ![info exists ::MyDiameter ] } {
set ::MyDiameter 1.0
}
set size [tk_dialogEntryRAM .gid.getdiameter [= "Diameter"] [= "Enter the diameter"] gidquestionhead real+ $::MyDiameter ""]
if { $size != "--CANCEL--" } {
set ::MyDiameter $size
}


----- Original Message -----
From: Andres Peratta
To: gidlist at listas.cimne.upc.edu
Sent: Monday, November 15, 2010 9:21 PM
Subject: [GiDlist] How to read the command line into a tcl variable?


Hi
Is there a way to get the data left by the user in the command line at the bottom of the screen from a tcl script ?
I would like to send a message to the user, such as for example:

GidUtils::SetWarnLine [_ "Enter the diameter ( default = %s )" $diam]

then wait for the user to type something in the command line, and then capture it in a variable.

Apologies if this has been explained before. I could not find the answer anywhere else.
Many thanks
Andres




------------------------------------------------------------------------------


_______________________________________________
GiDlist mailing list
GiDlist at listas.cimne.upc.edu
http://listas.cimne.upc.edu/cgi-bin/mailman/listinfo/gidlist
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20101116/31692d5d/attachment.htm
Post Reply