DisplayPipeline.Draw2dText in V6



Hi @dale, @stevebaer,

i have a custom conduit using DisplayPipeline.Draw2dText method in the PostDrawObjects event. In V5 it works, but in V6 nothing is drawn. I use this one which allows to pass a Point3d. Tries various overloads but none of them work in V6, if i draw in DrawForeground it works.


Found one more thing, probably related to Measure2dText. The following code:

rec = e.Display.Measure2dText(text, pt2d, True, 0, 12, "Arial")
e.Display.Draw2dRectangle(rec, Color.Black, 1, Color.Black)
e.Display.Draw2dText(text, Color.White, pt2d, True, 12, "Arial")

produced this in RH5:


In V6 it looks like this:


In regards to my first question, there seem no real order in which the elements are drawn using the DrawForeground event eg. an arrow drawn using DrawArrow before the rectangle and the text, shines through the rectangle and the text.


How can i prevent that ?


(Nathan 'jesterKing' Letwory) #4

I’m guessing @stevebaer knows best what’s going on here.

(Steve Baer) #5

This looks like https://mcneel.myjetbrains.com/youtrack/issue/RH-45226

which I fixed last night


@stevebaer, i can see changes for GH, TextTag is working now. I also see that i can use Draw2dText in the PostDrawObjects event of a conduit . But the Measure2dText is not working like in V5 unless i inflate the rectangle. Please compare this example in V5 and V6:

DrawTest.py (1.1 KB)

If you uncomment line 19 it works in V6, and the rectangle correctly obsures the arrow line which is what i want. How can i get this working in V5 ? There the arrow line shines through the rectangle and text, making it unreadable.

Also please note what happens to the text aliasing when you change it to DrawOverlay.



Hi @stevebaer, bewlow is an example image with the text aliasing. In V5 everyting is crystal sharp. In V6, i get different results. The left column shows how it looks while i rotate the view using RMB. Once i release the mouse it turns into the right column:


The text is drawn in a DrawForeground event.