Hi,
I am trying to create text curves using TextEntity directly in Python. The snipped from my Python script looks as follows:
texttainer = Rhino.Geometry.TextEntity()
texttainer.Text = “Some Text”
texttainer.Plane = Rhino.Geometry.Plane.WorldXY
texttainer.Justification = Rhino.Geometry.TextJustification.BottomLeft
texttainer.TextHeight = 100.0
texttainer.FontIndex = scriptcontext.doc.Fonts.FindOrCreate(“MecSoft_Font-1”, False, False)
textcurves = texttainer.CreateCurves(scriptcontext.doc.DimStyles.BuiltInStyles.CurrentDimensionStyle , True)
for textcurve in textcurves:
scriptcontext.doc.Objects.AddCurve(rs.coercecurve(textcurve))
Works, but all the text is exactly as high as the base unit of the model (1mm in my case) and the text resides at the world coordinate system’s origin.
I suspect, that TextHeight doesn’t set the height in the CurrentDimensionStyle properly or I need to use a different DimensionStyle.
Also I am wondering if there is a simple way to place the text curves at a specific position in the XY plane?
Any help would be appreciated (I know that I could script that using the Rhino command interface, but that’s not the point here).
Thanks a lot,
B.
