Save nodal results (from a cut) to a list in TCL.

Moderator: GiD Team

Post Reply
guillermoyr
Posts: 9
Joined: Tue May 02, 2017 8:48 pm

Save nodal results (from a cut) to a list in TCL.

Post by guillermoyr »

Hello GiD Community!

I'm trying to save the nodal results from the postprocess to a list in TCL. In the resulting model of the analysis, I made a cut (CutPlane) where I need to know the coordinates, displacements, etc. The cuts look like two square rings (yellow and red, one under another):

Image

I already converted them into a Set (Geometry>Convert to sets). Before I did this, the number of nodes was 413,303. And after that convertion, the number is 415,099 (I turned off some other layers, that's the reason for (413,303 + 914 yellow ring + 882 red ring=415,099), I supposed that the convertion was succesful, but, when I wanted to get the coordinates of the 413,303+1= 413,304 node with this command:

Code: Select all

[GiD_Info Mesh Nodes 413304-array -avoid_frozen_layers]
I get an empty list:

Code: Select all

{}{{}{}{}}
And if I get no result, there's no way to get the other nodal parameters that I need (displacements, stresses).

What do I need to do? Could you please help me?

I already tried the Select Results window, and THIS is what I want to get (ID,XCoord,YCood,ZCoord,XDisp,YDisp,ZDisp):

Image
User avatar
escolano
Posts: 1918
Joined: Sun Sep 05, 1982 10:51 pm

Re: Save nodal results (from a cut) to a list in TCL.

Post by escolano »

About
GiD_Info Mesh
This command by default returns information of the mesh of 'preprocess', not of 'postprocess'
to get information of post must use at the end the extra flags

-post -step <step>

(-step <step> is only needeed if the mesh is variable along the time steps)

And about the 'Select Results window'. It is showing just what do you want to get in Tcl, it is not?
The Tcl code of this window is implemented as a macro, that is pure Tcl scripting.
You can see the Tcl code of the macro as an example.

Click the second button of the 'macros toolbar', and in the macros window select the icon of 'ListResults' and you can see the Tcl code that is invoking
guillermoyr
Posts: 9
Joined: Tue May 02, 2017 8:48 pm

Re: Save nodal results (from a cut) to a list in TCL.

Post by guillermoyr »

Your answer is what a was looking for! I'll try the '-post' flag in my code and will post if this works for me.

About the 'ListResult'... I didn't realize that it was a macro! I just saw it. Actually what I wanted to get are the results (in a list to process them), not the window, but if I cannot extract those data from the 'GiD_Mesh -post' command, I'll try this way.

Thank you again Enrique!
escolano wrote:About
GiD_Info Mesh
This command by default returns information of the mesh of 'preprocess', not of 'postprocess'
to get information of post must use at the end the extra flags

-post -step <step>

(-step <step> is only needeed if the mesh is variable along the time steps)

And about the 'Select Results window'. It is showing just what do you want to get in Tcl, it is not?
The Tcl code of this window is implemented as a macro, that is pure Tcl scripting.
You can see the Tcl code of the macro as an example.

Click the second button of the 'macros toolbar', and in the macros window select the icon of 'ListResults' and you can see the Tcl code that is invoking
User avatar
escolano
Posts: 1918
Joined: Sun Sep 05, 1982 10:51 pm

Re: Save nodal results (from a cut) to a list in TCL.

Post by escolano »

all buttons of the 'macros toolbar' are macros that could be customized (could show/hide them and define new macros that are Tcl procedures)

About getting results, the 'GiD_Info mesh' GiD-Tcl command wont't be enough, you must use more commands, like 'GiD_Result'
Have a look to the available GiD-Tcl extra commands in Help->Customization manual->Tcl and Tk extension

And have a look to the related code of the 'ListResults' macro, It finally show the results in a window, but the data to fill the window is obtained with Tcl procedures (without any window)
macros_window.png
macros_window.png (86.42 KiB) Viewed 5451 times
Post Reply