Details
How to get the displayed value of a dimension?
Solution
To get the displayed value of a dimension user can use combination of
"GetDisplayData" and "GetTextAtIndex" API as shown in below sample code.
----------Sample Code Start----------------------
Dim objApplication As SolidEdgeFramework.Application = Nothing
Dim objDraftDocument As SolidEdgeDraft.DraftDocument = Nothing
Dim objSheet As SolidEdgeDraft.Sheet = Nothing
Dim objDimensions As SolidEdgeFrameworkSupport.Dimensions = Nothing
Dim objDimension As SolidEdgeFrameworkSupport.Dimension = Nothing
Dim x, y, xx, yx, zx, xz, yz, z, zz As Double
Dim DimData As SolidEdgeFrameworkSupport.DisplayData = Nothing
Dim str1 As String = ""
Dim i, j, count As Integer
Try
objApplication = Marshal.GetActiveObject("SolidEdge.Application")
objDraftDocument = objApplication.ActiveDocument
objSheet = objDraftDocument.ActiveSheet
objDimensions = objSheet.Dimensions
For Each objDimension In objDimensions
DimData = objDimension.GetDisplayData()
count = DimData.GetTextCount
For i = 0 To count - 1
DimData.GetTextAtIndex(i, str1, x, y, z, xx, yx, zx, xz,
yz, zz)
MsgBox(str1)
Next
Next
Catch ex As Exception
MsgBox(ex.Message)
Finally
End Try
-------------------------------------------------
Hardware/Software Configuration
Platform: AMD64
OS: windows
OS Version: 764
Product: SOLID_EDGE
Application: AUTOMATION
Function: API_DOCUMENT
Ref: 002-8014557