GiD - The personal pre and post processor
Python's IDLE shell in GiD
It is possible to open an IDLE shell, e.g. to try interactive Python commands, with the Tcl proc GiD_Python_Open_IDLE_Shell
In practice go to GiD top menu Utilities->Tools->Develop->Console Python…
Example:
The next picture shows the IDLE console, in which a Python command sets a variable with the current number of surfaces asked to GiD:
num_surfaces=tcl.GiD_Info("geometry","numsurfaces")
Then, it creates a new straight line in layer “Layer0” from point id ”1” to point id “2” and stores the returned new line id in a variable:
id_new_line=tcl.GiD_Geometry("create","line","append","stline","Layer0","1","2")
Note that the new line is not immediately shown until the model is redrawn. This can be done with with tcl.GiD_Redraw()
.
Note: The use of this console is recommended to interactively try several Python commands.
Note that GiD_ Tcl Commands are exposed in the python interpreter as tcl.GiD_....
. Visit GiD' Customization Manual to learn about GiD Tcl Commands .
COPYRIGHT © 2022 · GID · CIMNE