Creating Text to colored mesh


Is it possible to write a script in GHPython to create a text object and in the output represent both text and mesh object which could be defined colored mesh?

If someone knows that and how to write. I’ll appreciate the help.

Hello again, sorry for insisting on.
I’m grateful If someone could share an idea or any suggestion about my issue in helping me. :bouquet:

Could you be a little more clear for the input and output
Size …
Mesh (2d 3d ?)

you will find script that can do that if you search on old forum

Hi @laurent_delrieu.
Sure, Thanks for the reply.
here’s my plan for the script:

  1. Text as strings (it’s better to be list access)
  2. Font
  3. Size(text height)
  4. color


  1. Mesh (2d)
  2. colored mesh
  3. text object

Thank you.

Here is a small script. There are 2 C#, one ouputting all fonts (424 for me) and one outputing Brep. Brep are changed to mesh outside C#. It is surely not difficult to do it inside, so you can do it.
There is no placement of the text.
I am quite sure many plugins do this type of work but it was interesting to remake this script with the new Rhino 6 objects.

Frame_ (10.4 KB)

And for the record

    if(content != null && content != String.Empty
    && face != null && face != String.Empty )
      if(size == 0)
        size = 5;
      Rhino.DocObjects.Font.FontStyle fontStyle = Rhino.DocObjects.Font.FontStyle.Upright;
      if (italics) fontStyle = Rhino.DocObjects.Font.FontStyle.Italic;
      Rhino.DocObjects.Font.FontWeight fontWeight = Rhino.DocObjects.Font.FontWeight.Normal;
      if (bold) fontWeight = Rhino.DocObjects.Font.FontWeight.Bold;

      bool underlined = false;
      bool strikethrough = false;

      Rhino.DocObjects.Font font = new Rhino.DocObjects.Font(face, fontWeight, fontStyle, underlined, strikethrough);
      TextEntity text_entity = new TextEntity
          Plane = Plane.WorldXY,
          PlainText = content,
          Justification = TextJustification.MiddleCenter,
          Font = font
      Rhino.DocObjects.DimensionStyle dimstyle = new Rhino.DocObjects.DimensionStyle();
      dimstyle.TextHeight = size;
      double smallCapsScale = 1;
      double spacing = 0;
      A = text_entity.CreateSurfaces(dimstyle, smallCapsScale, spacing);
      Print("Some content is required.");

And see this


@laurent_delrieu wonderful!
Thank you so much. for your help.

Hi Laurent,
My old vector text tool which woked in Rhino 5 had a plane input, but it does not work in Rhino 6.
Is it possibble that you can add it to your text tool too?