Click or drag to resize

TextEntityJustification Property

Gets or sets the justification of text in relation to its base point.

Namespace:  Rhino.Geometry
Assembly:  RhinoCommon (in RhinoCommon.dll)
Since: 5.0
Syntax
public TextJustification Justification { get; set; }

Property Value

Type: TextJustification
Examples
using Rhino;
using Rhino.Commands;
using Rhino.Geometry;

namespace examples_cs
{
  public class TextJustifyCommand : Command
  {
    public override string EnglishName { get { return "csTextJustify"; } }

    protected override Result RunCommand(RhinoDoc doc, RunMode mode)
    {
      var text_entity = new TextEntity
      {
        Plane = Plane.WorldXY,
        PlainText = "Hello Rhino!",
        Justification = TextJustification.MiddleCenter,
        Font = doc.Fonts.FromQuartetProperties("Arial", false, false)
      };

      doc.Objects.AddText(text_entity);
      doc.Views.Redraw();

      return Result.Success;
    }
  }
}
Python
from scriptcontext import doc
from Rhino.Geometry import *

text_entity = TextEntity()
text_entity.Plane = Plane.WorldXY
text_entity.PlainText = "Hello Rhino!"
text_entity.Justification = TextJustification.MiddleCenter
text_entity.Font = doc.Fonts.FromQuartetProperties("Arial", False, False)

doc.Objects.AddText(text_entity)
doc.Views.Redraw()
See Also