Great release with the 1.6.0 version!
As always, with new features come new feature requests / questions
I have a few custom legends that I’d love to display in the HUD as well. Say for example this one with the custom daylight factor threshold lines below the legend.
In this case, the lines and extra text are just displayed with native Custom Preview and Text Tag 3D components, but I don’t know how to go about that with the visualization set / HUD. How can I tap into the Legend Parameters 2D / HUD functionality?
You can probably pull this off if you’re willing to edit the source code a little. The two main RhinoCommon methods that are being used to draw the HUD legend are DisplayPipeline.Draw2dText and DisplayPipeline.DrawSprite. You can see here inside the Preview VisualizationSet component, the arguments are being passed to those methods of the DisplayPipeline:
So, you could try adding some extra arguments into self.vis_con.draw_2d_text there for your custom text. Or you could make your own separate component that overwrites these methods.
If you do the latter, I found this post from @piac to be very helpful:
Sorry to tack on to this thread but I feel this solution may be relevant to my question. So I’ve got various legends that I’ve generated from the [LB Direct Sun Hours] component, and from the [LB Create Legend] component. Can I not use the [Legend Parameters 2D] component to translate either of these into a 2D Legend, or does the legend have to be derived from one of the {Visualize Data} components? I’ve tried various native ways to achieve this, but if I’m understanding this thread correctly, I would need to edit the Python source code to achieve the desired result? Either that or I’m misunderstanding how the component works (which is what I hope)!
You are correct that there’s not really a way to use the LB Create Legend component to make a custom screen-oriented legend. But what you are asking for here does not require a huge amount of code and it sounds generally useful. Let me think about the best way to implement this but we can probably add an official component for it.
Thanks for the reminder, @AbrahamYezioro . This is a bug, indeed. I just added a fix:
I’ll try to make sure that it becomes available via the LB Versioner by the end of tomorrow at the latest. If our CI runs smoothly, it may be available in as early as an hour.