Data Access in the Method Editor
To access individual properties of a model tree node, click the Data Access button either in the Main section of the Home tab, in the Application Builder, or in the Application section of the Developer tab in the Model Builder ribbon.
Alternatively, for certain form objects, for example, input fields, you can click the Data Access button in the header of the Source section of the Settings window. See also Data Access in the Form Editor.
Data Access needs to be enabled this way because a model typically contains hundreds or even thousands of properties that could be accessed, and the list would be too long to be practical.
When you click a model tree node, such as the Heat Flux node in the figure below, checkboxes appear next to the individual properties. This example is based on the busbar tutorial model described in Introduction to COMSOL Multiphysics.
In the figure below, the checkboxes for Heat transfer coefficient and External temperature are selected:
If you switch to the Editor Tools window, you will see additional nodes appear under the Heat Flux node. Right-click and use Get or Set to generate code in an active method window, as shown in the figure below.
In the example above, Get and Set for the Heat transfer coefficient and the External temperature properties will generate the following code:
model.component("comp1").physics("ht").feature("hf1").getString("Text");
model.component("comp1").physics("ht").feature("hf1").getString("h");
 
model.component("comp1").physics("ht").feature("hf1").set("Text", "293.15[K]");
model.component("comp1").physics("ht").feature("hf1").set("h", "htc");