You can use a function to create a command that will be used only in the current model.
To open the Modelica Command dialog box, refer to step 1 and 2 of Run a Script as Modelica command.
Select Call function.
Type the path to the function then click Edit function .
A dialog box appears to let you enter the values to be used in this function.
Enter your values and edit them if needed.
In this dialog box:
- Click Info to display a Help window and information about the function.
- Click Copy Call to copy the script with the values and create a new script.
- Click Close to exit the dialog box without running the script.
- Click OK to open the Modelica Scripting Window and close this dialog box.
- Click Execute to open the Modelica Scripting Window without closing this dialog box. This alllows you to test several values before validating.
Note:
The Modelica Scripting Window appears only to let you see the result of the function execution. Modifying values in the Modelica Scripting Window will not modify the associated Modelica command.
Click Close to exit the Modelica Scripting Window and/or the Call function dialog box.
The function's path with its associated arguments appears in the Call function field of the Command dialog box.
Enter a Description of the command in the corresponding field.
Select the Action on the model before command execution. For this, refer to step 6 of Run a Script as Modelica Command.
Check the box Prompt for inputs in the Modelica command execution option area if you want the function to start by popping up a dialog box where the input values can be modified.
Click OK
The Modelica Command Edition dialog box is closed and your Modelica command is created and appears in the Modelica Commands dialog box.
In the Modelica Commands dialog box, click Close.
The script is stored as a Modelica command for the model.