Creating Add-ins
Overview
To customize the workflow in the Model Builder you can use a Method Call or a Settings Form. However, these are associated with a specific MPH-file and you may want to reuse them between sessions or share them with colleagues. To make this possible, you can create an add-in, based on one or more method calls and settings forms that together implement some custom functionality that can be useful when creating model in the Model Builder. Such add-ins can then be stored in a user-defined Add-in Library. In addition, COMSOL Multiphysics comes with a built-in Add-in Library, which includes some example add-ins that you can use and explore. For the add-ins in the built-in library, you can review their Application Builder settings, including forms and methods, to quickly learn how to build your own add-ins. In a typical Windows installation, the built-in add-in library is located at
C:\Program Files\COMSOL\COMSOL61\Multiphysics\addins
Creating an add-in is similar to creating an application, with a few differences:
To create an add-in, starting from a form that you have created in the Application Builder, click Add-in Definition in the Home ribbon or right-click the root node in the Application Builder and then select Add-in Definition to add an Add-in Definition node. You can then right-click the Add-in Definition node or click the Add-in Attributes menu on the Home ribbon and select Form Definition, Method Definition, or Template Definition to add one or more corresponding subnodes for the definitions of the forms and methods that the add-in should provide in the Model Builder or for creating user-defined form templates. A minimum (and often sufficient) is to add a Form Definition for the form that will be used as a settings window for the add-in. When you are done, click the Create Add-in button () or press F8 in the Add-in Definition node’s Settings window or click Create Add-in. You can also add such nodes from the Home ribbon. See the following sections for details about the settings for the add-in definition nodes.
You can also right-click the Add-in Definition node and select Template Definition to create user-defined form templates.