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:
Oh wao, this is beautiful. What if i want to add more than one point? My python knowledge is limited, but if i change the input type to list is not enough
Rhino 8 now has native components that allow you to create Annotation Dots. In addition, I believe the preview issue (mentioned above) should be fixed if using these components. In the screenshot below, the Annotation Dot location is located behind the Rhino geometry (if seen from the perspective view). You can see that these dots will still show up on top of that geometry.
Oh! this is great news (I dont have rh8 ). Although i’d like to control more the fonts, size and color of this capsule dot text directly from grasshopper.
If you pass in a valid TextDot with all of it’s attributes set into the DrawDot method then it should show up accordingly. That’s what we’re using actually to draw these annotation dots on the screen. You can see all of the available Text Dot attributes here.
does this text dot visualization preserves perspective depth between other tex dots? (Sometimes in this python exercise i’ve notice that the depth in which every text dot is drawn on the screen depends on its order of creation in the list)
Is it possible to change the boundary color of the text dot? (In your image i see the black boundary, but what if i wanted that cyan too?)
For some applications, especially for printing, a text in a capsule is a better solution. You can define the colors and especially the size in an easier way compared to textdots.
Guys i’m not an expert in python as much as i wish to. I’m trying to create text dots for a list of points and texts with @martinborst1 script, but I’m kinda lost how to solve it. Do anybody has an answer for this problem?