ladybug_rhino.text module

Functions to add text to the Rhino scene and create Grasshopper text objects.

class ladybug_rhino.text.AlignmentTypes[source]

Bases: object

Enumeration of text alignment types.

classmethod horizontal(field_number)[source]

Get a Rhino horizontal alignment object by its integer field number.

  • 0 - Left

  • 1 - Center

  • 2 - Right

classmethod vertical(field_number)[source]

Get a Rhino vertical alignment object by its integer field number.

  • 0 - Top

  • 1 - MiddleOfTop

  • 2 - BottomOfTop

  • 3 - Middle

  • 4 - MiddleOfBottom

  • 5 - Bottom

  • 6 - BottomOfBoundingBox

class ladybug_rhino.text.TextGoo(*args: Any, **kwargs: Any)[source]

Bases: Text3d, IGH_BakeAwareData, IGH_PreviewData

A Text object that can be baked and transformed in Grasshopper.

The code for this entire class was taken from David Rutten and Giulio Piacentino’s script described here: https://discourse.mcneel.com/t/creating-text-objects-and-outputting-them-as-normal-rhino-geometry/47834/7

Parameters:

text – A Rhino Text3d object.

BakeGeometry(doc, att, id)[source]
DrawViewportMeshes(args)[source]
DrawViewportWires(args)[source]
DuplicateGeometry()[source]
static DuplicateText3d(original)[source]
GetBoundingBox(xform)[source]
Morph(xmorph)[source]
ScriptVariable()[source]

Overwrite Grasshopper ScriptVariable method.

ToString()[source]

Overwrite .NET ToString method.

Transform(xform)[source]
get_Boundingbox()[source]
get_ClippingBox()[source]
get_TypeDescription()[source]
get_TypeName()[source]
ladybug_rhino.text.text_objects(text, plane, height, font='Arial', horizontal_alignment=0, vertical_alignment=5)[source]

Generate a Bake-able Grasshopper text object from a text string and ladybug Plane.

Parameters:
  • text – A text string to be converted to a a Grasshopper text object.

  • plane – A Ladybug Plane object to locate and orient the text in the Rhino scene.

  • height – A number for the height of the text in the Rhino scene.

  • font – An optional text string for the font in which to draw the text.

  • horizontal_alignment – An optional integer to specify the horizontal alignment of the text. Choose from: (0 = Left, 1 = Center, 2 = Right)

  • vertical_alignment – An optional integer to specify the vertical alignment of the text. Choose from: (0 = Top, 1 = MiddleOfTop, 2 = BottomOfTop, 3 = Middle, 4 = MiddleOfBottom, 5 = Bottom, 6 = BottomOfBoundingBox)