It's hard to say exactly what you're looking for but here are a couple approaches I played around with. I'm not sure how to get the secondary dual dimension but I'm sure there's a way with the index of GetDimension2 or something.
DisplayDimension dd = (DisplayDimension)swAnno.GetSpecificAnnotation();
((Dimension)dd.GetDimension2(0)).Value // output (25.4)
((Dimension)dd.GetDimension2(0)).SystemValue // output (0.0254)
Edit: Nevermind, the index is only used with Chamfer dimensions. I'd have to dig more to see if the dual dimension can be pulled directly.
The DisplayDimension object is what you want. It has a GetText method.
Sorry... Doesn't get the right text.
I took a look at all of the GetText options and it appears to return everything but the dimensions. For example, see my output below for that same 25.4 [1.000] linear value I tested above.
Again for this value:
If you want to get the actual displayed value, you may have to figure it out yourself...
As Alex mentioned, you can get the value in document units rather than using SystemValue.
Then, you can look at the PrimaryPrecision of the DisplayDimension to determine what to round it to. Of course, you also need to check if the value is overridden with displayDimension.GetOverride.
Another possible approach would be to compare the Value with the pieces of text returned from the underlying Annotation's DisplayData object using GetTextAtIndex. It returns the actual pieces of text that make up what's displayed on screen. However, it is a bit unpredictable at which index the desired value falls, so that's why you still have to compare Value with the displayed text. It gets tricky if the displayed text is, say, 8.94, but the actual value is 8.9378 or something... You'd have to compare a rounded version of the dimension to each text piece from the DisplayData. Doesn't sound fun.
Josh, thanks for your thoroughness and detailed explanation/options. I will try to work through and see if i can come up with the appropriate output using your suggestions. & you are right ...it doesn't sound fun...lol
Dim swApp As SldWorks.SldWorks
Dim swDraw As SldWorks.DrawingDoc
Dim swDispDim As SldWorks.DisplayDimension
Dim boolstatus As Boolean
Set swApp = Application.SldWorks
Set swDraw = swApp.ActiveDoc
'boolstatus = swDraw.Extension.SelectByID2("RD1@Drawing View1", "DIMENSION", 0, 0, 0, False, 0, Nothing, 0)
If swDraw.SelectionManager.GetSelectedObjectType3(1, -1) = 0 Or swDraw.SelectionManager.GetSelectedObjectType2(1) <> swSelectType_e.swSelDIMENSIONS Then
MsgBox ("Select a dimension")
Set swDispDim = swDraw.SelectionManager.GetSelectedObject6(1, -1)
Dim myValue As String
myValue = swDispDim.GetDimension2(0).Value
Dim myPrecision As Long
myPrecision = swDispDim.GetPrimaryPrecision
myValue = Round(myValue, myPrecision)
Do While myPrecision > Len(myValue) - InStr(myValue, ".")
myValue = myValue & "0"