Background Information
Text can be linked to properties of elements and are referred to as text fields (fields). These texts differ from properties of normal texts because they also have attached the attributes as dependency links (dependency linkages).
Steps
If you want to specifically look for these text boxes and choose one, you may find it difficult because they usually are hard to distinguish between normal and text fields. You can recognize these fields by additional attribute that are attached, as in this example. You can get additional information with the Keyin "Analyze element" which displays the following:
The important thing is circled in red, "Application ID: 9993", which serves as a tool to recognize specific data. You can search for this if you include a function such as MDL mdlDependency_getLinkage.
Here is an example of how to use this feature and select all text boxes:
Type root data(1024) As Byte elemid(128) As Byte far_elemid(64) As Byte e_v(64) As Byte far_e_v(42) As Byte assoc(25) As Byte a_i(21) As Byte assoc1_i(42) As Byte elemidInModel(64) As Byte path_v(128) As Byte End Type Type DependencyLinkage appID As Integer appValue As Integer flags As Long nRoots As Integer toFill As Integer rootele As root End Type Declare Function mdlDependency_getLinkage Lib "stdmdlbltin.dll" (ByVal pLinkage As Long, ByVal maxSize As Long, ByVal pEl As Long, ByVal appID As Integer, ByVal appValue As Integer) As Long Sub fields_find() Dim Ee As ElementEnumerator Dim EeSub As ElementEnumerator Dim Sc As New ElementScanCriteria Dim oT As TextElement Dim Db() As DataBlock Dim l() As String Dim sum As Long Dim Stat As Long Dim lElementP As Long Dim Dep As DependencyLinkage ActiveModelReference.UnselectAllElements Sc.ExcludeAllTypes Sc.IncludeType msdElementTypeTextNode Set Ee = ActiveModelReference.Scan(Sc) Do While Ee.MoveNext Set EeSub = Ee.Current.AsTextNodeElement.GetSubElements Do While EeSub.MoveNext Set oT = EeSub.Current lElementP = modElementAccess.GetMSElementFromElement(oT) Stat = mdlDependency_getLinkage(VarPtr(Dep), 1024, lElementP, 9993, 0) If Stat = 0 Then ActiveModelReference.SelectElement Ee.Current End If Loop Loop End Sub
The fields_find routine first searches for all text nodes, because fields are automatically linked to text nodes, even if only one text element is included.
It is then checked whether a dependency exists linking to an item that was written with the Application ID 9993.
Important note about the above code sample:
The modElementAccess.GetMSElementFromElement function from the Project Native Code Utilities is used. This requires the project to be referenced and the function to be defined.
This can be done by going to References under Tools in the VBA Editor, and "Select" or "Browse" to load it into the MicroStation project as shown below:
You can find the project in the workspace under ..\Workspace\system\VBA\examples