I’m trying to display preview meshes relating to structural engineering quantities in the Rhino viewport.
Also, I’m trying to display a corresponding legend in the same viewport.
Rhino.Display.DisplayPipeline.PreDrawObjects for the meshes
Rhino.Display.DisplayPipeline.DrawForeground for the legend
I get pretty convincing results. So far so good (here a little screenshot of a suspension bridge with stresses displayed as meshes, and a little summary legend at the bottom):
The issues arise when I want to export the viewport somehow. For instance, when using
ViewCaptureToFile or ViewCaptureToClipboard,
the legend (as well as the Rhino coordinate system) is shrunk and duplicated:
Even worse, when I use “_Print” to export as pdf, my legend gets shrunk and tiled all over the drawing numerous times:
Is there a way around this? I tried to prevent the DrawForeground event from getting called numerous times when Rhino is InCommand. This helped with ViewCaptureToFile as I found out the event gets raised exactly twice, but when printing, the number of times it is raised depends on the clicks the user makes in the print dialog.
Is there a better/best practice for displaying legends/frames/watermarks in a viewport or print? As the information changes all the time (for example when the user display other attributes than stresses), creating a proper 2d-layout with a header of Rhino geometry/text objects is not really an option.
Thanks a lot,