Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This part translates the entered values into variables that can be used to create the emitter and adjust its physical properties. To trigger this process, the script has to check first whether the entered values have been accepted or not. That is necessary, because each window shows an “OK” and a “Cancel” button. By confirming with “OK”, you tell RealFlow that the values have been accepted and should be used to feed the script. This query is done with the show() function:

Code Block
themeEclipse
languagepython
int show()

...

The statement returns an integer specifying the button you have pressed. 1 stands for “OK” and 2 indicates that the operation has been aborted with “Cancel” or the ESC key. The query itself is packed into an if-condition to start with the translation of the values. Similar to the “get” instruction with parameters, where you can read out values from nodes, GUI functions also offer the get statement:

...

Now it is already possible to execute the script and check the GUI for plausibility. As you can see from the image on the right, RealFlow takes the field definitions and directly lists them in the order you have specified. That is new, because in previous program versions the fields were added alphabetically and you had to add a suffix, for example an enumeration to create a certain order. In case you want to use older scripts you can remove the prefix now.

...

The GUI so far with the defined fields.