3D text with python

Is it possible to place 3D text with python script without manual input?

rs.AddText(“Hello Rhino!”, point, height, font, style, justification) is just plane text.

rs.Command("_TextObject _Pause _No _Pause _Impact _Pause _Yes") does not work

Or do i have to select object from rs.AddText(“Hello Rhino!”) and convert this somehow to surface or lines?

Hi singlefonts:
I hope it can help you

AddText.py (724 Bytes)

import rhinoscriptsyntax as rs
import Rhino.Geometry as rg
import scriptcontext as sc

def addtext(point,height1,distance):
text = rs.AddText(“Hello Rhino!”, point, height1)
new_text = rs.ExplodeText(text,True)
surface = rs.AddPlanarSrf(new_text)
new_surface = [rs.coercesurface(i) for i in surface]
list = surface+new_text
Text = [rg.Brep.CreateFromOffsetFace(j,distance,0.01,False,True) for j in new_surface ]
new_Text = [sc.doc.Objects.AddBrep(j) for j in Text]
rs.DeleteObjects(list)
sc.doc.Views.Redraw()
group = rs.AddGroup(“text”)
rs.AddObjectsToGroup(new_Text,“text”)

if name==“main”:
rs.EnableRedraw(False)
addtext([0,0,0],3,0.3)

1 Like

Hello Steve,
The code works fine. thank you very much. I was never able to solve it on my own, this year and next year.
with kind regards,Mart

import rhinoscriptsyntax as rs
rs.Command(’-textobject Helloworld 0,0,0 _enter’)

This can also be

This option is much easier, thanks. Good enough for my idea.

Subtle difference between “-” and “_”.

Once at the beginning used the same command line with “_”. Then there is popup screen “text object”. In the text object screen you can set the text properties.

After this only used the command with “-” and the text properties stay then same as set at the beginning.