Center Textentity


Is it possible to center a textentity?
I can’t set align anywhere and getboudingbox does only return the align point…

Thank you.


Center on what? I think I need more information. :wink:

– D

Hi Jordy,

Not sure if this helps but I found in python it can be done like so:

import rhinoscriptsyntax as rs
import scriptcontext
import Rhino

obj = rs.SelectedObjects()[0]
rhobj = rs.coerceguid(obj)
rhgeom = rs.coercegeometry(obj)

rhgeom.Justification = Rhino.Geometry.TextJustification.MiddleCenter



@Willem Exactly what I was looking for.
Just couldnt find the Allign part anywhere. Thought it would be under rhgeom.allign or something.

Thank you.

@dale What I have is a rectangle and the text needs to be in the center-center of this rectangle. I was able to center-center the reference point of the textentity but could not change the allignment of it.

Here is (another) sample if anyone is interested.