Calling Functions from a Library

You can call existing functions from libraries. This lets you enter values and automatically launch the Scripting window.


Before you begin: Open a library containing functions.

For example, open Mechanics > MultiBody > Frames from the Modelica Standard Library.

Related Topics
Creating/Running a Script with the Scripting Window
  1. Right-click the angularVelocity1 function to display the contextual menu.

    Note: A function is usually displayed in the Package Browser with a circled 'f', but this icon can be customized.

  2. Select Object > Call Function... from the contextual menu.

    A dialog box appears to let you enter the values to be used in the function.

  3. Enter your values. In our example:

    1. For t values: Click the Edit button to open the following dialog box.

    2. Enter your values then click OK to close the dialog box.
    3. For r values: Click the Edit button to open the following dialog box.

    4. Enter your values then click OK to close the dialog box.

    Values are taken into account.

  4. Click the arrow at the end of an input field to access the following commands:

    • Edit : to edit the input field.
    • Edit Text: to edit the input field in a separate dialog box.
    • Copy Default: to overload the value with the default value specified in the Modelica text of the function.

      For example, to enter “18” as a default value, type in the Modelica text: put String FunctionName= "18". You can also refer to Editing Modelica Text).

  5. Select OK or Execute to run the script. (OK will also close the function call dialog box, Execute will keep the dialog box open.) You could also select:

    • Info to display a Help window and display information about the function.

    • Copy Call to copy the script with the values and create a new script.
    • Close to exit the dialog box without running the script.

    The script is launched and the Scripting Window displays the result.

  6. Click Close to exit the Scripting window and angularvelocity1 dialog boxes.