Curly braces are removed from text set with Rhino.TextObjectText using VB Script

It seems that the Rhino.TextObjectText function called from a VB Script removes all curly braces “{” and “}” from the text to be written into a text object. It works from the UI though. I have tried several ways of escaping the curly braces e.g."{" but it did not work, and I could not find any documentation on this.
Here is the script which I used for testing (The string is intended to be displayed as barcode with Code 128 font):

Option Explicit
Call Main()
Sub Main()
Dim strText, arrPoint, dblHeight, strObj
arrPoint = Array(0, 0, 0)
dblHeight = 10
strText = “Auftrag”
strObj = Rhino.AddText(strText, arrPoint, dblHeight)
strText = “Ò4#{Í-18TS-CSC8-1iÓ”
Rhino.TextObjectText strObj, strText
End Sub

The curly brace gets removed and the barcode doesn’t work.

Can you use Python/rhinoscriptsyntax?

This seems to work here:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import rhinoscriptsyntax as rs

arrPoint = rs.coerce3dpoint([0, 0, 0])
dblHeight = 10
strText = "Auftrag"
strObj = rs.AddText(strText, arrPoint, dblHeight)
strText = "Ò4#{Í-18TS-CSC8-1iÓ"


This seems to work here

a = Rhino.AddText("aa", array(0, 0, 0), 20)
Rhino.TextObjectText a, "11" & chr(123) & "22" & chr(125) & "33"


Thank you for this hint!

Interesting, it does not work on my system.
I have Rhino Version 6 SR30
(6.30.20288.16411, 14.10.2020)
Also tried it on Rhino 7 WIP and it showed the same problem.

Still Rhino 6 SR20 on Win 10 here …
Maybe something has changed for newer versions. :confused: