Page 1 of 1
Automating geometry creation process
Posted: Thu Apr 20, 2017 8:11 am
by awa5114
In GiD 12 and 13, is it possible to 'automate' the following process:
1) creating geometries,
2) assigning conditions,
3) generating mesh
4) generating calculation file
For example, I have one problem where I would like to generate 10 prisms with varying thickness and mesh size, and generate the .dat files for them automatically then batch calculate. I am only talking about pre-processing. How can I do this in GiD?
Re: Automating geometry creation process
Posted: Thu Apr 20, 2017 5:30 pm
by escolano
You can create a 'batch' file with the keywords of GiD to do what you want, and run GiD following the commands of this file
e.g.
gid.exe -b <batchfile>
(there are more flags to run without any window, etc.)
or from the GUI could run the batch from the menu Files->Import->Batch file...
(and also a little more interactive, allowingn set stops, etc. with Utilities->Tools->Read batch window...)
About the 'keywords' of the batch file, to know them do you have several approaches,
for example,
1) you can do an action as user and then open the 'Undo window' (Utilities->Undo) . Unfortunatelly this window don't allow to copy its text.
2) all actions are automatically recorded (for the Undo) in a temporary .batch file, you can open this file with an editor and copy text.
Note: you can know what is this temporary folder with the Tcl command "GiD_Info project TmpDirectory"
e.g. writting this in the lower entry:
-np- W [GiD_Info project TmpDirectory]
3) you can use the tool that record a macro (top icon of the macros toolbar), and see its code after be recorded.
4) you can show the 'right buttons' (Utilities->Tools->Toolbars... set 'Right buttons' inside). These buttons show the keywords available on each state.
The bath file is only a flat collection of keywords, it not a programming language.
For more complicated cases is is possible to do is with Tcl scripting language, that send keywords to be processed by GiD with 'GiD_Process' and ask data with GiD_Info and other GiD special Tcl commands.
Re: Automating geometry creation process
Posted: Fri Apr 21, 2017 6:59 am
by awa5114
Thank you very much