Some commands only make sense in a batch file like “if” and “while”. Please have a look into “If and while demo” on how to work with this commands. Results can be extracted and stored to a file, see “How to write values to a file”.
Be aware of the 'examples' directory. It holds examples on how to use the command language as a programming language. The 'ifwhiledemo' generates points in a loop and shows how to write cgx generated values to a file. The 'userDataset' shows how to generate a user dataset for a temperature field based on the z coordinate of the nodes.
It should be noted that a successive 'save' or 'exit' command will overwrite the batch file if it has the file-extension 'fbd'. To prevent this the user should use a different extension like 'fbl' instead of 'fbd'.
When executing commands which increase the used space then it might happen that geometry is clipped and can not be seen or accessed anymore. In such a case a “frame” command is needed. This command is usually automatically triggered. Especially in batch mode without graphic output it solves sometimes strange situations.
When the command “init” or “wsize” is used then they have to be used in the very first line. Otherwhise the window dimensions take only effect after the batch file was completely parsed and executed.