ObjectTableAddText Method (String, Plane, Double, String, Boolean, Boolean) |
Namespace: Rhino.DocObjects.Tables
public Guid AddText( string text, Plane plane, double height, string fontName, bool bold, bool italic )
using System; partial class Examples { public static Rhino.Commands.Result AddAnnotationText(Rhino.RhinoDoc doc) { Rhino.Geometry.Point3d pt = new Rhino.Geometry.Point3d(10, 0, 0); const string text = "Hello RhinoCommon"; const double height = 2.0; const string font = "Arial"; Rhino.Geometry.Plane plane = doc.Views.ActiveView.ActiveViewport.ConstructionPlane(); plane.Origin = pt; Guid id = doc.Objects.AddText(text, plane, height, font, false, false); if( id != Guid.Empty ) { doc.Views.Redraw(); return Rhino.Commands.Result.Success; } return Rhino.Commands.Result.Failure; } }
import Rhino import scriptcontext import System.Guid def AddAnnotationText(): pt = Rhino.Geometry.Point3d(10, 0, 0) text = "Hello RhinoCommon" height = 2.0 font = "Arial" plane = scriptcontext.doc.Views.ActiveView.ActiveViewport.ConstructionPlane() plane.Origin = pt id = scriptcontext.doc.Objects.AddText(text, plane, height, font, False, False) if id!=System.Guid.Empty: scriptcontext.doc.Views.Redraw() return Rhino.Commands.Result.Success return Rhino.Commands.Result.Failure if __name__=="__main__": AddAnnotationText()