Je pense que la modification effectue sur le lien precedement peu correspondre a ton besoin
'This example shows how to get the values of the dimensions in a drawing.
'---------------------------------------------------------------------------
' Preconditions:
' 1. Open a drawing document.
' 2. Open the Immediate window.
'
' Postconditions: Inspect the Immediate window.
'---------------------------------------------------------------------------
Option Explicit
Sub main()
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swDraw As SldWorks.DrawingDoc
Dim swView As SldWorks.View
Dim swDispDim As SldWorks.DisplayDimension
Dim swDim As SldWorks.Dimension
Dim swAnn As SldWorks.Annotation
Dim swModelDocExt As SldWorks.ModelDocExtension
Dim boolstatus As Boolean
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swDraw = swModel
'Debug.Print "File = " & swModel.GetPathName
Set swView = swDraw.GetFirstView
Do While Not swView Is Nothing
'Debug.Print " View = " & swView.Name
Set swDispDim = swView.GetFirstDisplayDimension5
Do While Not swDispDim Is Nothing
Set swAnn = swDispDim.GetAnnotation
Set swDim = swDispDim.GetDimension
Debug.Print " DimFullName = " & swDim.FullName
Debug.Print " Value = " & swDim.GetSystemValue2("")
Debug.Print " CalloutBelow = " & swDispDim.GetText(swDimensionTextCalloutBelow)
Set swModelDocExt = swModel.Extension
boolstatus = swModel.Extension.SelectByID2(swDim.FullName, "DIMENSION", 0, 0, 0, False, 0, Nothing, 0)
boolstatus = swModelDocExt.EditDimensionProperties(0, 0, 0, "", "", True, 9, 2, True, 1, 1, "", "", True, "", "Texte à remplacer", "", True, swThisConfiguration, "")
swModel.ClearSelection2 True
Set swDispDim = swDispDim.GetNext3
Loop
Set swView = swView.GetNextView
Loop
End Sub
à toi de mettre des condition pour mettre le texte correspondant