Creating a Part
Following these steps to create a part that you can store in a part library and use as a part or specialized geometric primitive:
1
2
Right-click the Global Definitions node, and from the Geometry Parts submenu, choose 3D Part, 2D Part, or 1D Part to add a Part node for a 3D, 2D, or 1D geometry. You can also choose Create Part from the Parts menu in the Other section of the Geometry toolbar to create a Part node of the same space dimension as the current component in the model.
3
In the Part node’s Settings window, give it an appropriate label. Also choose an appropriate length unit. If you want the part model to be available to users without a license for the CAD Import Module, make sure to choose COMSOL kernel from the Geometry representation list under Advanced.
4
In the Input Parameters table, add input parameters with appropriate names, default values, and descriptions. Use standardized input parameter names for all parts in a part library. This makes automatic matching work when a user substitutes one part for another; that is, the values of input parameters with the same name are kept. In the Default expression column, prefer to indicate the unit because this helps the user to understand what is expected. The default expression then also determines what unit to use if the user just enters a number when calling the part.
5
Parameters that are used within the part but should not be specified by users of the part, should instead be entered in the Local Parameters node. A local parameter is typically having a fixed value or is depending on the input parameters. If you have deleted the Local Parameters node, add it under the Part node and add the local parameters in its Settings window.
6
7
8
-
-
-
Give each work plane feature an appropriate label. Use standardized labels in all parts in a part library. Doing so makes automatic matching of work planes work when a user substitutes one part for another.
9
Click the Build All button.
10
Run a Compact History command (from the File menu) to save some space in the MPH-file.
11
Set the model thumbnail image by clicking the Set from Graphics Window button in the root node’s Settings window. If you want to use an image processor to, for example, add dimension arrows showing the meaning of the input parameters, then use the Load from File button instead to choose a file with the image to use as the thumbnail.
12
Open the root node’s Properties window and set Application version to 1. You might also add an Author.
13