Menu with Action
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.
Right-click the Menu with Action node to add Item and Item / Button, Toggle Item, or Separator, nodes. You can also add an Activation Condition.
The Settings window includes the following sections:
Command
Define a command type from the Command type list: Internal action tag (the default) or Command handler from code editor.
For Internal action tag, enter the tag in the Action tag field.
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.
For External resources, choose a file from the Imported file list.
From the Link list, choose a link for the command.
Definition
Some of the settings are only available when Command type is Command handler from code editor.
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.
Condition to Run
This section is only available when Command type is Command handler from code editor.
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.