Good evening,
I have a problem when creating a text with Python. In the default text style the option for “orient text toward the reader when viewed from behind” is checked. Of course I could change that option in the template, but what if I wanted to control this in my code?
If not, is there an option to set the textstyle via code? This woudl be really comfortable.
This is the code I am using. All variables not specified here are set in the code above via rhinoscriptsyntax.
Option 1
text_entity = Rhino.Geometry.TextEntity()
text_entity.Plane = pln
text_entity.TextHeight = size
text_entity.Text = text
text_entity.Justification = justification
text_entity.FontIndex = sc.doc.Fonts.FindOrCreate(font, False, False)
item = sc.doc.Objects.AddText(text_entity)
rs.ExplodeText(item, delete=False)
Option 2
item = sc.doc.Objects.AddText(text, pln, size, font, False, False, justification)
sc.doc.Views.Redraw()
rs.ExplodeText(item, delete=False)
5 posts - 2 participants