When starting the GiD program from a shell or script it is possible to supply several options in the same command line.

Command line syntax:

gid -h -n|-n2 ?-b <batch_file>? ?-t <tcl_command>? ?-p <problemtype>? ?-e <cmd>? ?-c|-c2 <ini_file>? ?-m <macros_file>? ?<model_name>?

All options and model_name are optional. filename is the name of a problem to be opened (the .gid extension is optional).

Options are:

  • -h shows GiD's command line valid arguments.
  • -n runs the program without any window. It is most useful when used with the option batchfile. Tcl is loaded but not Tk and most GiD scripts.
  • -n2 runs the program with minimized window, the Tk library and GiD scripts are loaded. This option is useful if you use Tcl and maybe Tk commands in a batch file.
  • -b <batch_file> executes batch_file as a script file (see Batch file ).

It allow some modifiers to have more control, just after -b without extra spaces:

  • +/- g Enable/Disable Graphics (if -g, GiD does not redraw until the batch file has finished).
  • +/- i Enable/Disable GraphInput (enable or disable peripherals while the batch file is being executed: mouse, keyboard, etc.).
  • +/- w Enable/Disable Windows (GiD displays - or does not display - windows which require interaction with the user).

  • -t <tcl_command> to evaluate tcl code just after read the filename if it has been specified

example:

gid -t "WarnWinText [GiD_Info Project]"

C:\temp\myexample

  • -p <problem_type> loads problem as the type of the problem to be used for a new project.
  • -e <cmd> to execute <cmd> as a 'process GiD command'.
  • -c <ini_file> to read preferences from an alternative user configuration file, instead the default 'gid.ini' (e.g. to run batch tests with preference values specified in a file).
  • -c2 <ini_file> to read/write with an alternative user configuration file, instead the default 'gid.ini' (e.g. to store separatelly preferences of problemtype or GiD version)

The difference between -c and -c2 is that -c only read the configuration file, but not try to write it with current values when exit GiD.

  • -m <macros_file> to set and alternative user macros file instead of the default 'Macros.tcl' (e.g. to use different files for some problemtype loaded with -p <problemtype>
  • -openglconfig 1|0

1 to force show a window that allows you to choose between the accelerated OpenGL, if present, or the generic implementation.

0 to force not to show the window.

If the flag is not set, or is set to other value then the selection window is showed only the first time that GiD starts.

Note: by default, when running a batch file from the command line or importing a Batch file from the 'Files->Import' menu, graphics are disabled, and then for example is not possible to save an snapshot in a file. To enable graphic features use gid -b+g batchfile

On the other hand when reading a file with the Read batch window graphics are enabled.

Other useful options are:

  • gid -compress [ -123456789ad] file_name_in file_name_out

in order to compress (gzip) a file, e.g. to compress '.dat' files or new postprocess formatted data files.

And:

  • gid [ -PostBinaryFormat { 1.0 / 1.1}] -PostResultsToBinary file_in file_out

in order to transform ASCII results files into compressed binary ones. You can select whether to use the binary format 1.0 or 1.1. The default format (recommended) is 1.1.

  • gid -tclsh ?<tcl_filename>?

To source a file in a tclsh or open an interactive Tkcon console, replacing the use of tclsh.exe

  • gid -version

That returns in the standard output the string with the version of GiD

Offscreen mode:

Since GiD version 10.1.3b there is a new executable called 'gid_Mesa' which, together with the above described options, also has two new options:

-offscreen [ WIDTHxHEIGHT] --> to launch GiD in OffScreen mode ( with no graphic window)

--> using an in memory framebuffer of WIDTH x HEIGHT pixels ( by default 960x640)

--> This option is useful to launch GiD in batch mode ( in background) to create images and animations without any graphic feedback, for instance to create very large animation using a batch queue on a remote computer or in background.

-output file_name -> Writes GiD's stdout into $file_name file.

Invoking GiDCommand line arguments