Solid Edge FrameworkSupport Type Library
GetTextAndFontAtIndex Method
The index of the text component.  The main dimension value is index 0 and others, like tolerance, prefix, etc. are the other text components.  Use GetTextCount to find the number of text components.  A simple dimension will only have a value component.
The displayed text of that text component.
The name of the font used for that text component.
The X-component of the origin of the text component.
The Y-component of the origin of the text component.
The Z-component of the origin of the text component.
The X-component of the X-direction vector of the text component.
The Y-component of the X-direction vector of the text component.
The Z-component of the X-direction vector of the text component.
The X-component of the Z-direction vector of the text component.
The X-component of the Z-direction vector of the text component.
The X-component of the Z-direction vector of the text component.
Description
Syntax
Visual Basic
Public Sub GetTextAndFontAtIndex( _
   ByVal Index As Long, _
   ByRef TextString As String, _
   ByRef FontName As String, _
   ByRef OriginX As Double, _
   ByRef OriginY As Double, _
   ByRef OriginZ As Double, _
   ByRef X_DirX As Double, _
   ByRef X_DirY As Double, _
   ByRef X_DirZ As Double, _
   ByRef Z_DirX As Double, _
   ByRef Z_DirY As Double, _
   ByRef Z_DirZ As Double _
) 
Parameters
Index
The index of the text component.  The main dimension value is index 0 and others, like tolerance, prefix, etc. are the other text components.  Use GetTextCount to find the number of text components.  A simple dimension will only have a value component.
TextString
The displayed text of that text component.
FontName
The name of the font used for that text component.
OriginX
The X-component of the origin of the text component.
OriginY
The Y-component of the origin of the text component.
OriginZ
The Z-component of the origin of the text component.
X_DirX
The X-component of the X-direction vector of the text component.
X_DirY
The Y-component of the X-direction vector of the text component.
X_DirZ
The Z-component of the X-direction vector of the text component.
Z_DirX
The X-component of the Z-direction vector of the text component.
Z_DirY
The X-component of the Z-direction vector of the text component.
Z_DirZ
The X-component of the Z-direction vector of the text component.
Remarks
Both the X and Z direction vectors are normalized to be unit vectors.  The Y direction vector can be computed by taking the cross product of the Z and X direction vectors, i.e. Y = Z CROSS X.
Example
Imports System.IO
Imports System.Runtime.InteropServices
Public Class Form1


    Private Sub GetTextAndFontAtIndex_Click(sender As Object, e As EventArgs) Handles GetTextAndFontAtIndex.Click
        Dim objApplication As SolidEdgeFramework.Application = Nothing
        Dim SEInstallDir As DirectoryInfo
        Dim PartDoc As SolidEdgePart.PartDocument = Nothing
        Dim DraftDoc As SolidEdgeDraft.DraftDocument = Nothing
        Dim Dimensions As SolidEdgeFrameworkSupport.Dimensions = Nothing
        Dim PMIcoll As SolidEdgeFrameworkSupport.PMI = Nothing
        Dim Csys As SolidEdgePart.CoordinateSystem = Nothing
        Dim CsysS As SolidEdgePart.CoordinateSystems = Nothing
        Dim oDim As SolidEdgeFrameworkSupport.Dimension = Nothing
        Dim DimData As SolidEdgeFrameworkSupport.DisplayData = Nothing
        Dim x As Double
        Dim y As Double
        Dim z As Double
        Dim Xdirx As Double
        Dim Xdiry As Double
        Dim Xdirz As Double
        Dim Zdirx As Double
        Dim Zdiry As Double
        Dim Zdirz As Double
        Dim x2 As Double
        Dim y2 As Double
        Dim z2 As Double
        Dim i As Integer
        Dim iCnt As Integer
        Dim FontName As String = Nothing
        Dim Str1 As String = Nothing

        Try
            objApplication = Marshal.GetActiveObject("SolidEdge.Application")
            SEInstallDir = GetTrainingFolder()
            PartDoc = objApplication.Documents.Open(SEInstallDir.FullName + "\Spindle1.par")
            Call PartDoc.PMI_ByModelState(PMIcoll, SolidEdgePart.PMIModelStateConstants.seDesignModelState)

            Dimensions = PMIcoll.Dimensions
            CsysS = PartDoc.CoordinateSystems

            For Each oDim In Dimensions
                DimData = oDim.GetDisplayData
                iCnt = DimData.GetTextCount
                For i = 0 To (iCnt - 1)

                    DimData.GetTextAndFontAtIndex(i, Str1, FontName, x, y, z, Xdirx, Xdiry, Xdirz, Zdirx, Zdiry, Zdirz)
                    x2 = x + Xdirx
                    y2 = y + Xdiry
                    z2 = z + Xdirz
                    'Add Coordinate System to identify the exact point on screen
                    Csys = CsysS.Add(x, y, z)
                    Csys = CsysS.Add(x2, y2, z2)
                    x2 = x + Zdirx
                    y2 = y + Zdiry
                    z2 = z + Zdirz
                    Csys = CsysS.Add(x2, y2, z2)
                Next i
            Next
        Catch ex As Exception
            MsgBox(ex.ToString)
            Clipboard.SetText(ex.ToString)
        End Try
    End Sub

    Function GetTrainingFolder() As DirectoryInfo
        Dim objInstallData As SEInstallDataLib.SEInstallData = Nothing
        Dim objInstallFolder As DirectoryInfo = Nothing
        Dim objTrainingFolder As DirectoryInfo = Nothing

        Try
            objInstallData = New SEInstallDataLib.SEInstallData
            objInstallFolder = New DirectoryInfo(objInstallData.GetInstalledPath())
            objTrainingFolder = New DirectoryInfo(Path.Combine(objInstallFolder.Parent.FullName, "Training"))
        Catch
        Finally
            If Not (objInstallData Is Nothing) Then
                Marshal.FinalReleaseComObject(objInstallData)
                objInstallData = Nothing
            End If
        End Try

        Return objTrainingFolder
    End Function
End Class
See Also

DisplayData Object  | DisplayData Members  | Solid Edge ST4 - What's New