However, when I create Grasshopper preview of active objects (Rhino geo is hidden in that case),
text dots can not overlap GH preview and are hardly readable.
Active objects in the pic below are pink and shiny light blue (is that you, SolidWorks?)
As you see, text dots are hardly even noticeable.
Hi Martin,
Thanks for the link,
I went through it, but I am not sure if I read the situation correctly.
So this weird preview is known issue for 4 years already, but no solution? (except from using something else that text dot)
I also ran across one topic you also participated in and tried that approach (move text dot location base on camera view angle), but it was not feasible for my case.
While there might be plugins available, it’s certainly possible using scripting components. See e.g. this topic for a hack that enables one to draw 2D objects in screen space on top of the 3D viewport objects:
To draw a text dot you can implement the DrawDot method. I’ve used this code pattern quite a bit recently for drawing HUDs etc. For instance the text dots and dynamic bar chart seen here:
Hello, I could make drawing the dots kind of work, but I still can’t make sure that the dots are removed properly once the component is deactivated or the C# script component gets deleted.
Where to remove the event handler for Rhino.Display.DisplayPipeline.DrawForeground?
This gets you 80% there. You will notice, however, that the dashboard is now persistent even if you remove the script from your document or switch to a different one. Ideally, you would unregister from the DrawForeground event handler in the following two cases but I only know how to do it from a compiled component. Maybe someone else can help you with the script component counterparts:
public override void DocumentContextChanged(GH_Document document, GH_DocumentContext context) {}
public override void RemovedFromDocument(GH_Document document) {}
Does the C# scripting component not have equivalents to the GHPython __enter__/__exit__ methods? I’ve been using those to add/remove event handlers quite robustly since learning about them over here: