Simple c# Display Conduit Example


#1

I’m trying to get my head around the Display Conduit class. In particular, it would be great to see super simple examples of a couple features, (like 2d text display, object transformation, etc). For the 2d text, here’s what I have so far:

public class DataDisplay : DisplayConduit
    {
        public DataDisplay()
        {
        }

        protected override void PostDrawObjects(DrawEventArgs e)
        {
            e.Display.Draw2dText("Hello World!", System.Drawing.Color.Black, 
                                              new Point2d(25, 25), true, 16);
            
            base.PostDrawObjects(e);
        }
    }

In terms of usage, I’d like to have this text be persistent (i.e. stay on the screen) after running a custom rhino command.

Is there any documentation on this class (other than just the lists of properties and members) ?


(Menno Deij - van Rijswijk) #2

There are examples on the McNeel wiki:

http://wiki.mcneel.com/developer/rhinocommon/ (end of page)

Specifically, these are of interest:


Also, more examples found in the github repo of Dale Fugier at:

PS: could you change the category on the topic to “Developer”?