Custom text and line display in GHPython?

Hi,

Would it be possible to display text, with a custom font, size and colour, and curves, with custom line thicknesses, styles and colours, directly from GHPython in Rhino?
If so, where can I find the corresponding developer docs or reference?

My goal is basically to develop some kind of HUD (head-over display) for a script that I’m working on.

I’m not sure I understand completely, but I’ll stick to the last part:

What you seem to need is using WinForms or Eto. Creating GUIs

http://api.etoforms.picoe.ca/html/R_Project_EtoForms.htm

https://docs.microsoft.com/en-us/dotnet/framework/winforms/getting-started-with-windows-forms

For…

You need to check Conduit, I guess.

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Display_DisplayConduit_PreDrawObjects.htm

1 Like

Let’s say I want to overwrite how my GHPython component shows certain curves. A curve by default displayed as continuous and red, should for instance be shown as pink and dotted in Rhino and its length should be displayed somewhere.

Thanks for the reply!

Interesting question.

I think it’s this class here, but I don’t see LineType only thickness and color.

https://developer.rhino3d.com/api/grasshopper/html/T_Grasshopper_Kernel_GH_PreviewWireArgs.htm

1 Like

Thanks.

Maybe a simpler solution, without scripting?

1 Like

I like to use the CustomDisplay class for rendering simple vector based graphics (i.e. no line styles) from GHPython (the legend in my solar hours thingie is an example). There’s a couple of caveats though, read more here:

2 Likes