Use a Menu with Action (

) node to customize a context menu or toolbar of the physics interface with an action connected to it. This node adds a submenu.
To add a Menu with Action node, right-click a
User Input or
Selectable Input node and select it from the
Buttons menu.
The Settings window includes the following sections:
For Command handler from code editor, choose an option from the
Links from list:
Building blocks (the default),
Built in, or
External resources.
For Built in, choose a COMSOL package from the
Package list.
COMSOL Multiphysics is the default package.
From the Link list, choose a link for the command.
Enter a Title of the menu in the text field and an icon file in the
Icon field (or click
Browse (

) to pick an icon file from the file system).
The Weight field contains a factor (an integer number) that can be used to decide the order of the items in a context menu. It is available (editable) when the
Menu items ordering list is set to
Use weighting order in the Settings window for a
Context Menu node. Under a toolbar menu, the weight is always 0 and this field is not editable.
Select the Record a custom COMSOL API command checkbox and type a name for using an API call equivalent to clicking the button as
runCommand(<name>), where
<name> is a string with the name that you enter in the
Command field.
Select the Always show the title checkbox to always display the title. It is selected by default if you use the button style.
Select the Use button style if possible checkbox if desired. This setting is only available for a button under a user input. It uses the style of a button instead of just text.
Select the Show confirmation dialog checkbox if desired. If selected, enter a message for the confirmation dialog and an answer to use in the
Message and
Answer fields, respectively.