Click the Record Code button in the
Code section of the Method Editor ribbon to record a sequence of operations that you perform using the model tree, as shown in the figure below.

Clicking the Record Code button will add code to an existing method. To record a new method, click the
Record Method button. This button is also available in the
Main section of the
Home tab of the Form Editor or Method Editor ribbon.

In addition, you can click the Record Method button in the
Developer tab of the Model Builder ribbon.
To stop recording code, click one of the Stop Recording buttons in the ribbon of either the Model Builder or the Application Builder.

The previous section on Data Access demonstrated how to set the values for the
Heat transfer coefficient and
External temperature properties in the busbar tutorial model. Alternatively, you can achieve this using the
Record Code feature. To generate similar code using this method, follow these steps:
Note that in File >
Preferences you can enable the use of
with() statements in order to make the code more compact. For more information on the use of
with(), see
The With Statement.
To generate code corresponding to changes to the application object, use Record Code or
Record Method, then go to the Form Editor and, for example, change the appearance of a form object. The following code corresponds to changing the color of a text label from the default
Inherit to
Blue: