General

General

How do you use define variable names in a TUI command?

Tagged: ansys-fluent, tui

    • FAQFAQ
      Participant

      You need to define variables using the define command and then use the format command.
      Consider the example below where two variables are defined by define command
      – 1st sets the directory location and 2nd sets the file name. These variables are then used in the TUI command by using the format command.
      Here the TUI command writes a mesh file to the specified directory and file name. Note ~a ~a is replaced by the variable values.
      (define dir_name “/temp/box/bit/”)
      (define file_name “mesh1.msh”)
      (define command (format #f “file/wm ~a/~a” dir_name file_name))
      (ti-menu-load-string command)