Need help with text in grasshopper

I want to make a Text Object as I would in Rhino and have the output as curves, But I want to do this programmatically in Grasshopper. The closest I’ve come so far is
TextTrouble.gh (6.5 KB)
Is there a good way to do text settings? The only way I’ve found is with the Annotation Style text settings and one problem there is that the size is affected by model space scale setting in Rhino. The other issue is that I can’t find a definition of Text Entity. I wanted to flow the text along a curve, but the flow component won’t accept the text as geometry so I grouped the text with a group component and it would not accept it unless I took the Text Entity output instead of the text. But it still didn’t work with the flow component. It seems this should not be so difficult. I’m working in Rhino8.
sys info follows
Rhino 8 SR8 2024-5-28 (Rhino 8, 8.8.24149.15001, Git hash:master @ 49367284ece6544c4e32d4d2fce81c37a1bd9dff)
License type: Commercial, build 2024-05-28
License details: Cloud Zoo

Windows 10 (10.0.19045 SR0.0) or greater (Physical RAM: 8GB)
.NET 7.0.12

Computer platform: LAPTOP - Plugged in [100% battery remaining]

Hybrid graphics configuration.
Primary display: Intel(R) UHD Graphics 630 (Intel) Memory: 1GB, Driver date: 11-13-2023 (M-D-Y).
> Integrated graphics device with 3 adapter port(s)
- Windows Main Display is laptop’s integrated screen or built-in port
Primary OpenGL: NVIDIA Quadro P600 (NVidia) Memory: 4GB, Driver date: 3-14-2024 (M-D-Y). OpenGL Ver: 4.6.0 NVIDIA 538.49
> Integrated accelerated graphics device with 4 adapter port(s)
- Video pass-through to primary display device

OpenGL Settings
Safe mode: Off
Use accelerated hardware modes: On
Redraw scene when viewports are exposed: On
Graphics level being used: OpenGL 4.6 (primary GPU’s maximum)

Anti-alias mode: 4x
Mip Map Filtering: Linear
Anisotropic Filtering Mode: High

Vendor Name: NVIDIA Corporation
Render version: 4.6
Shading Language: 4.60 NVIDIA
Driver Date: 3-14-2024
Driver Version: 31.0.15.3849
Maximum Texture size: 32768 x 32768
Z-Buffer depth: 24 bits
Maximum Viewport size: 32768 x 32768
Total Video Memory: 4 GB

Rhino plugins that do not ship with Rhino

Rhino plugins that ship with Rhino
C:\Program Files\Rhino 8\Plug-ins\Commands.rhp “Commands” 8.8.24149.15001
C:\Program Files\Rhino 8\Plug-ins\rdk.rhp “Renderer Development Kit”
C:\Program Files\Rhino 8\Plug-ins\RhinoRenderCycles.rhp “Rhino Render” 8.8.24149.15001
C:\Program Files\Rhino 8\Plug-ins\rdk_etoui.rhp “RDK_EtoUI” 8.8.24149.15001
C:\Program Files\Rhino 8\Plug-ins\NamedSnapshots.rhp “Snapshots”
C:\Program Files\Rhino 8\Plug-ins\MeshCommands.rhp “MeshCommands” 8.8.24149.15001
C:\Program Files\Rhino 8\Plug-ins\RhinoCycles.rhp “RhinoCycles” 8.8.24149.15001
C:\Program Files\Rhino 8\Plug-ins\Toolbars\Toolbars.rhp “Toolbars” 8.8.24149.15001
C:\Program Files\Rhino 8\Plug-ins\3dxrhino.rhp “3Dconnexion 3D Mouse”
C:\Program Files\Rhino 8\Plug-ins\Displacement.rhp “Displacement”
C:\Program Files\Rhino 8\Plug-ins\SectionTools.rhp “SectionTools”

I use this for 90% of my projects: Multiline Text Outline GHPython | Food4Rhino … best implementation of text to curves that I’ve found.

1 Like

Thanks, Ben. I’ll try it out and try to understand it. Would still like to understand what a Text Entity is and how a person is supposed to supply Text Settings to the Text Entity component. There seem to be several Grasshopper components that appear unfinished IMHO.

Using SanghoonYoon’s script, I’m getting a little closer to understanding. I’m not a big fan of Python so I’m hoping to convert his techniques to C#. Here’s what I’ve done so far.
PlayingWithTextinGH.gh (19.5 KB)
But I’m going to have to spend some more time studying the Rhino API to try to understand the DocObject settings. Some things don’t seem to work the same in C#. It took a while to discern what some of the Rhino annotation components were in GH and how to use them but am beginning to see how they tie together. Wish the documentation was better. Are you listening McNeel??

I’m stuck because the C# script component won’t accept Center as the property of Rhino.DocObject.TextHorizontalAlignment.
image
Why is this? Am I doing something wronb, or is this a bug?

This seems to work.

-Kevin

Thanks, Kevin
I’m finally getting something after studying more of the API and SangHoonYoon’s phthon example. I’ve still got to work on alignment but looks like I’m getting close. Very unhappy with the new API website. I keep having to go back to the old style to find the info I need.
PlayingWithTextEntity.gh (5.6 KB)

Okay. I think I’ve had enough beating my head against the wall for one day. Here is a dead simple TextEntity thing in C#.
SimpleTextEntity.gh (4.9 KB)
I have made the thing show in the Front View. Why does it send the letters up the Z axis instead of displaying them horizontally? I took the TextEntity and created curves. Why oh why does it take the letters and reverse them and why do the curves not follow the size of the letters in the TextEntity??? I can take the curves and transform them, but why should I have to do that??