TextDot display (C#)

I’m trying to display a TextDot object in a rhino viewport.

Surface surface = null;

 DA.GetData("Surface", ref surface);

 Point3d northPoint = surface.PointAt(surface.Domain(0).Mid, surface.Domain(1).Max);
 Point3d southPoint = surface.PointAt(surface.Domain(0).Mid, surface.Domain(1).Min);
 Point3d eastPoint = surface.PointAt(surface.Domain(0).Max, surface.Domain(1).Mid);
 Point3d westPoint = surface.PointAt(surface.Domain(0).Min, surface.Domain(1).Mid);

 TextDot northDot = new TextDot("North", northPoint);
 TextDot southDot = new TextDot("South", southPoint);
 TextDot eastDot = new TextDot("East", eastPoint);
 TextDot westhDot = new TextDot("West", westPoint);

I fount some info here and here. But I’m not able to implement it into my C# code. Can somebody help me?

if I recall correctly you have to add them to the object table with one of this methods:

Grasshopper itself does not have TextDot data as a type, so if you want to draw them you’ll have to write the code to do so.

I recommend storing all textdots in a centralised list which you populate during all calls to SolveInstance(). Then override the DrawPreviewWires method on your component and draw them using the display pipeline you’re given as an argument.