Click or drag to resize

AnnotationObjectBaseDisplayText Property

Gets the text that is displayed to users.

Namespace:  Rhino.DocObjects
Assembly:  RhinoCommon (in RhinoCommon.dll)
public string DisplayText { get; }

Property Value

Type: String
using Rhino;
using Rhino.DocObjects;
using Rhino.Commands;
using Rhino.Input.Custom;

namespace examples_cs
  public class ReadDimensionTextCommand : Rhino.Commands.Command
    public override string EnglishName
      get { return "csReadDimensionText"; }

    protected override Result RunCommand(RhinoDoc doc, RunMode mode)
      var go = new GetObject();
      go.SetCommandPrompt("Select annotation");
      go.GeometryFilter = ObjectType.Annotation;
      if (go.CommandResult() != Result.Success) 
        return Result.Failure;
      var annotation = go.Object(0).Object() as AnnotationObjectBase;
      if (annotation == null)
        return Result.Failure;

      RhinoApp.WriteLine("Annotation text = {0}", annotation.DisplayText);

      return Result.Success;
from Rhino import *
from Rhino.DocObjects import *
from Rhino.Commands import *
from Rhino.Input.Custom import *
import rhinoscriptsyntax as rs

def RunCommand():
  go = GetObject()
  go.SetCommandPrompt("Select annotation")
  go.GeometryFilter = ObjectType.Annotation
  if go.CommandResult() <> Result.Success:
    return Result.Failure
  annotation = go.Object(0).Object()
  if annotation == None or not isinstance(annotation, AnnotationObjectBase):
    return Result.Failure

  print "Annotation text = {0}".format(annotation.DisplayText)

  return Result.Success

if __name__ == "__main__":
Version Information

Rhino for Mac

Supported in: 5.4

Rhino for Windows

Supported in: 6.2
See Also