[CONNECT u15 VBA] CreateTextElement1 using Template

Hi,

when creating a text element with CreateTextElement1() using a Template, then the color of the template isn't applied to the new text:

Sub TextTemplateTest()
    
    Dim oTextTemplate As TextElement
    Set oTextTemplate = CreateTextElement1(Nothing, "*", Point3dZero, Matrix3dIdentity)
    oTextTemplate.Color = 3
    oTextTemplate.LineWeight = 3
    
    Dim oText As TextElement
    Set oText = CreateTextElement1(oTextTemplate, "test", Point3dZero, Matrix3dIdentity)
    
    ' Check: LineWeight is ok, Color isn't!
    Debug.Print "oText.Color = " & CStr(oText.Color) & ",   oText.LineWeight = " & CStr(oText.LineWeight)
End Sub

The output is: oText.Color = 0,   oText.LineWeight = 3.

Sould I mention that this used to work in V8i? Does anybody believe it's not a bug in Microstation?

Parents Reply Children