Button
The Button node () adds a text or image button beside a user input or selectable input.
To add a Button node, right-click a User Input or Selectable Input node and select it from the Buttons menu. You can right-click the Button node to add an Activation Condition or Input Dependency subnode.
The Settings window has the following sections:
Command
If the Command type is set to Internal action tag (the default), you enter a tag for the action in the Action tag field.
If the Command type is set to Command handler from code editor, you determine the source using the Links from list. Available options are:
Building blocks. Lets you choose among the Code Editor node under the Components branch in the Building Blocks branch. You choose the code editor from the Link list. Click the Add button () to display a quick menu where you can select a source to add in to the list and use it as the current reference. A Confirm Operation dialog will appear and ask for confirmation if there is already a reference exist in the Link list. Click the Go to Source button to move to the referenced node in the Link list.
Built in. Lets you choose among built-in code editors that are available to the Physics Builder. In the Package list you choose the main resource to use a code editor from (or None). For each resource, you have a list of code editors in the Link list to choose from. You can only choose among the currently published code editors. The list shows Not active if no links are available.
External resources. Lets you choose among the code editors listed in an imported builder file under the External Resources branch. You choose the file from the Imported file list. The Link list contains all code editors found in the Building Blocks > Components branch of the selected file.
The remaining two sections are only available if the Command type list is set to Command handler from code editor.
Definition
Enter a title of the button in the Title 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 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 Always show the title checkbox to always display the title. It is selected by default if you use the button style.
Condition to Run
Select the Show confirmation dialog checkbox if you want to display a confirmation dialog as a preaction for the toggle item’s action. Type a message for the confirmation dialog in the Message field and a confirmation answer in the Answer field (default: Yes). The confirmation dialog also contains a Cancel button by default. You can use this functionality to ask for confirmation before performing the action.