VBA Code Modify Text Attributes

Hi all, could anyone help me with a VBA code to perform the following scenarios?

  • All text in the level <EXI_410> in DGN Model must be changed having the following attributes:

Font = ENGINEERING (3)
Height = 1.4
Width = 1.4
Justification = CenterCenter

  • All text in the level <EXI_635> in DGN Model must be changed having the following attributes:

Font = ENGINEERING (3)
Height = 0.8
Width = 0.8
Justification = CenterCenter

The DGN Model could have a huge amount of text in different type of levels.

I've also tried to record some simple macros, but the result is not what I need. My macro only records commands to check/uncheck the boxes in the Change Text Attributes tool and modify my text with those attributes that are already by default. I've not figured out yet how to change those attributes (font, size, justification) with mine in the code.

Bentley Microstation V8i (SELECTSeries 3) 08.11.09.578

Thank u in advance! Slight smile

Below u can find my recorded macro for one type of text:

Sub ChangeTextAtt()
    Dim startPoint As Point3d
    Dim point As Point3d, point2 As Point3d
    Dim lngTemp As Long

'   Start a command
    CadInputQueue.SendCommand "MDL SILENTLOAD SELECTBY dialog"

    CadInputQueue.SendCommand "DIALOG SELECTBY"

    CadInputQueue.SendCommand "SELECTBY LEVEL EXI_410"

    CadInputQueue.SendCommand "SELECTBY LEVEL EXI_410"

'   Set a variable associated with a dialog box
    SetCExpressionValue "selectorGlobals.typemask[0]", 5009, "SELECTBY"

    SetCExpressionValue "selectorGlobals.typemask[1]", -1223, "SELECTBY"

    SetCExpressionValue "selectorGlobals.typemask[2]", -30, "SELECTBY"

    SetCExpressionValue "selectorGlobals.typemask[3]", -1, "SELECTBY"

    SetCExpressionValue "selectorGlobals.typemask[4]", -1, "SELECTBY"

    SetCExpressionValue "selectorGlobals.typemask[5]", -8257, "SELECTBY"

    SetCExpressionValue "selectorGlobals.typemask[6]", -257, "SELECTBY"

    SetCExpressionValue "selectorGlobals.typemask[7]", -1, "SELECTBY"

'   The following statement opens modal dialog "Alert"

    CadInputQueue.SendCommand "SELECTBY EXECUTE"

    CadInputQueue.SendCommand "MDL UNLOAD SELECTBY"

    CadInputQueue.SendCommand "MODIFY TEXT"

    SetCExpressionValue "tcb->msToolSettings.changeText.font", 1, "MODIFY"

    SetCExpressionValue "tcb->msToolSettings.changeText.height", 1, "MODIFY"

    SetCExpressionValue "tcb->msToolSettings.changeText.width", 1, "MODIFY"

    SetCExpressionValue "tcb->msToolSettings.changeText.just", 1, "MODIFY"
    
    CommandState.StartDefaultCommand
End Sub