ActiveField™ Help

Main QuickField Site     Free Downloads     Contacts

ActiveField Technology
What's New
Objects Overview
Hierarchy Chart
How to Start: Application Object
How to work with Problems
How to work with Model
How to work with Data
How to Analyze Results




Label Object




Named set of physical properties that can be assigned to a block, an edge or a vertex in the model.


Represents a label in the property description document (data document). Each Label object is a member of one of three Labels collections, which contains Labels of the same type: vertex label, edge label, and block label.

Using the Label Object

To get a specific Label in the Labels collection, use the Item( index) method of Labels collection. Parameter Index is the name of the label or one-based number. The Item method is a default method for Labels collection, so you can omit its name.

The Labels collection manages creating and removing separate Label objects. The Add method of Labels collection creates a new empty Label. The Labels collection also gives methods to Remove the Label and Insert a label from another collection.

Each label has a name - a string literal of up to 16 characters. Label's name is case sensitive. The Name property of the Label object allows you to get and set the label's name. The Type property of the Label object returns the label's type that indicates what kind of geometric object the label is applied to. Once created, the label type cannot be changed. Please note, you might have two or three labels of different types with the same name. In this case all the labels are considered as a different objects.

The Content property of the Label object returns an object representing physical data associated with the label. When you need to change the physical data you have to get label's Content, modify it, and then put it back to the label. The exact type of that object depends upon both ProblemType and Label's Type. In some situations when you do not need very specific details of physical data you can use a generalized form of label content object. These are: LabelBlock for block label, LabelEdge for edge label and LabelVertex for vertex label content.

The following example changes the permeability and current values of the "coil" block label for the prb Problem of magnetostatics:

Dim coilData As LabelBlockMS
Set coilData = prb.DataDoc.Labels(qfBlock).Item("coil").Content
With coilData
    .Kxx = 1
    .Kyy = 1
    .TotalCurrent = True
    .Loading = 500
End With
prb.DataDoc.Labels(qfBlock).Item("coil").Content = coilData

Dim borderData As LabelEdgeMS
Set borderData = prb.DataDoc.Labels(qfEdge).Item("Border").Content
With borderData
    .Dirichlet = 0
End With
prb.DataDoc.Labels(qfEdge).Item("Border").Content = borderData