Local functions are directly created in the Block Editor. Their
usage remains local to the block.
Select Add User Function
in the Predefined Blocks toolbar.
Click the place in the blank sheet where you want to
position the function. The User Function Block Properties
dialog box is displayed.

Click Parameters in the left-side tree.
Set the input parameters:

- Click twice on Add Param
.
- Set the inputs names A and B.
- Select the Type using the combo.
Check Named Interface to display the name
of the input parameters in the 2D viewer.
If Named Interface is selected, the root
parameter of the function input is a structure. Otherwise it is a tuple.
Click Result in the left-side tree.
Select Tree Mode. This mode is more convenient
if the result is a structured data.
Enter the function result.
- Click twice on Add Param
.
- Set the structure element names to Perimeter and
Surface.
- Enter the result expression.

- You can switch to Text Mode to see the
result in that mode.

Click the Properties tab. You can change
the default instance name of the block. You can use the Visible check
boxes to define whether the value of the function or the instance name
will be displayed in the Block editor.

When Automatic is checked, the name of the
instance is the expression of the function.
Click OK. The function block is displayed
in the blank page. The instance is added to the tree.
