# Creating HUD for information of plugin objects

**URL:** <https://discourse.mcneel.com/t/creating-hud-for-information-of-plugin-objects/102362>\
**Category:** Rhino Developer\
**Tags:** rhinocommon\
**Created:** [May 18, 2020, 9:31am UTC](https://discourse.mcneel.com/t/creating-hud-for-information-of-plugin-objects/102362 "2020-05-18T09:31:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![oguzhankoral](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/oguzhankoral/32/476137_2.png) [@oguzhankoral](https://discourse.mcneel.com/u/oguzhankoral)\
**Post date:** [May 18, 2020, 9:31am UTC](https://discourse.mcneel.com/t/creating-hud-for-information-of-plugin-objects/102362/1 "2020-05-18T09:31:07Z")

</div>

Hi everyone,

I am developing plugin that already functional as desired for now. I want to add HUD feature for that. I was looking samples and documentation about that but a bit confused when I try to impement HUD.

1. I created `MyPluginDisplayMode` object inherited from `RealtimeDisplayMode` object to use HUDs. (I didn’t add any implementation for overriden methods come from `RealtimeDisplayMode`)
2. I registered this object as `MyPluginDisplayMode.RegisterDisplayModes(PlugIn);`
3. I initialized it in `MyPluginViewModel` object which is inherited from `Rhino.UI.ViewModel`
4. Lastly I used this method `variableName.HudShow();`

When I open my plugin in rhino nothing initializing, what I am missing something in structure?

**I want to achieve below image**

 ![hud](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/b/c/bc097560503211b2fc68beb673dea30fdf06d975.jpeg)

Thanks in advance  
-Oguzhan

---

<div class="post-metadata">

**Author:** ![D-W](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/d-w/32/771450_2.png) [@D-W](https://discourse.mcneel.com/u/D-W)\
**Post date:** [May 18, 2020, 10:01am UTC](https://discourse.mcneel.com/t/creating-hud-for-information-of-plugin-objects/102362/2 "2020-05-18T10:01:28Z")

</div>

I can be wrong maybe sth changed but AFAIK to draw on top of viewport you have to override [DisplayConduit](https://developer.rhino3d.com/guides/rhinocommon/display-conduits/)

> [@oguzhankoral](#):
>
> registered this object as `MyPluginDisplayMode.RegisterDisplayModes(PlugIn);`

Not familiar with this though…

> [@oguzhankoral](#):
>
> (I didn’t add any implementation for overriden methods come from `RealtimeDisplayMode` )

I guess this is the problem (?) to draw those shouldn’t you use `e.Display.MethodName` ?

---

<div class="post-metadata">

**Author:** ![nathanletwory](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nathanletwory/32/482880_2.png) [@nathanletwory](https://discourse.mcneel.com/u/nathanletwory)\
**Post date:** [May 18, 2020, 10:08am UTC](https://discourse.mcneel.com/t/creating-hud-for-information-of-plugin-objects/102362/3 "2020-05-18T10:08:26Z")

</div>

The HUD feature for realtime display mode integrations is probably not what you’re looking for, unless you plan to actually integrate a realtime rendering engine.

DisplayConduit is what you need.

Probably the most useful sample code:

> <https://github.com/mcneel/rhino-developer-samples/blob/6/rhinocommon/cs/SampleCsCommands/SampleCsDrawViewportLogo.cs>

---

<div class="post-metadata">

**Author:** ![oguzhankoral](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/oguzhankoral/32/476137_2.png) [@oguzhankoral](https://discourse.mcneel.com/u/oguzhankoral)\
**Post date:** [May 18, 2020, 10:30am UTC](https://discourse.mcneel.com/t/creating-hud-for-information-of-plugin-objects/102362/4 "2020-05-18T10:30:12Z")

</div>

Hi @nathanletwory and @D-W,

I tried sample, it’s kind of that I am trying to do but I want them in different Display Mode.

I want to create plugin specific display mode that when user switch to it, will be able to see some dynamic values, some of them text some of them graphs as you can see below image.

Is it possible to do that with DisplayConduit

 ![displayMode](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/e/5/e59a74fcbdede6bef25061cb5222d6b5a2cf9665.jpeg)

Thanks for replies

---

<div class="post-metadata">

**Author:** ![D-W](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/d-w/32/771450_2.png) [@D-W](https://discourse.mcneel.com/u/D-W)\
**Post date:** [May 18, 2020, 10:35am UTC](https://discourse.mcneel.com/t/creating-hud-for-information-of-plugin-objects/102362/5 "2020-05-18T10:35:05Z")

</div>

You should be able to know what display mode is currently picked so i guess checking it and turning on/off hud will work - @nathanletwory should know if there is event to hook up like OnDisplayModeChanged or sth similar.

---

<div class="post-metadata">

**Author:** ![nathanletwory](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nathanletwory/32/482880_2.png) [@nathanletwory](https://discourse.mcneel.com/u/nathanletwory)\
**Post date:** [May 18, 2020, 10:36am UTC](https://discourse.mcneel.com/t/creating-hud-for-information-of-plugin-objects/102362/6 "2020-05-18T10:36:47Z")

</div>

Check if the `View.DisplayMode` of the DrawEventArgs you get in your implementation corresponds to your display mode. If not just return early from the draw function.

---

<div class="post-metadata">

**Author:** ![oguzhankoral](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/oguzhankoral/32/476137_2.png) [@oguzhankoral](https://discourse.mcneel.com/u/oguzhankoral)\
**Post date:** [May 18, 2020, 10:51am UTC](https://discourse.mcneel.com/t/creating-hud-for-information-of-plugin-objects/102362/7 "2020-05-18T10:51:30Z")

</div>

As response my question briefly, is it enough to use DisplayConduit for HUD texts and graphs? Or will I need RealtimeDisplayMode? I still confused sorry.

---

<div class="post-metadata">

**Author:** ![nathanletwory](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nathanletwory/32/482880_2.png) [@nathanletwory](https://discourse.mcneel.com/u/nathanletwory)\
**Post date:** [May 18, 2020, 10:56am UTC](https://discourse.mcneel.com/t/creating-hud-for-information-of-plugin-objects/102362/8 "2020-05-18T10:56:44Z")

</div>

You don’t need the RealtimeDisplayMode, unless you integrate a render engine like Cycles (from Blender) is integrated in Rhino as Raytraced. If you just have a regular display mode, and want to show extra information you use just the DisplayConduit.

---

<div class="post-metadata">

**Author:** ![oguzhankoral](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/oguzhankoral/32/476137_2.png) [@oguzhankoral](https://discourse.mcneel.com/u/oguzhankoral)\
**Post date:** [May 18, 2020, 11:16am UTC](https://discourse.mcneel.com/t/creating-hud-for-information-of-plugin-objects/102362/9 "2020-05-18T11:16:52Z")

</div>

@nathanletwory @D-W  
Thanks for enlightening to both of you, I will try with this structure and let this topic know for other people.  
Best wishes!
