Here are the code I had discovered, but I want to develope it a little bit.
1. can I select all the dimension with that specify text (in this case is FIT text)
2. Does it has any method to find dimensions with 'positioned texts'
Sub CATMain()
Dim myDrawing As DrawingDocument
On Error Resume Next
Set myDrawing = CATIA.ActiveDocument
If (Err.Number <> 0) Then
MsgBox ("A CATDrawing must be active")
Exit Sub
End If
If (InStr(myDrawing.Name, ".CATDrawing")) = 0 Then
MsgBox ("The active window must be a CATDrawing")
Exit Sub
End If
Err.Clear
On Error GoTo 0
Dim selection1 As Selection
Set selection1 = myDrawing.Selection
selection1.Clear
selection1.Search "CATDrwSearch.DrwDimension.Visibility=Shown"
For i = 1 To selection1.count
Set MyDimension = selection1.Item(i).Value
Set MyDimValue = MyDimension.GetValue
MyDimValue.GetBaultText 1, MyBefore, MyAfter, MyUpper, MyLower
Dim afr, count
afr = Right(MyAfter, 4)
If afr = " FIT" Then
count = count + 1
End If
Next
MsgBox count
End Sub