Example about Display Model in Viewport Control

As mention above, is there any example show how to display model in Viewport Control(in Rhino.UI.Controls) Which embed in Dialog or Form? thanks

Does this thread help @1056960357?

Thanks, csykes ,But how can I draw model in this Viewport embed XAML form? @csykes

This viewport would view the standard model elements, would you like just like to see something in this Viewport?

I want to display individual 3dm file in this viewport,It is possible?

It is @1056960357.
I’m aware of two routes ocne the 3dm is loaded in. Are you okay with that step?
For every element you can either;

1. ViewportId Filter

Add elements to the Document with a specific attribute

Curve myCurve;
ObjectAttributes attribs = new ObjectAttributes
{
  // This means it only shows in the xaml 
  ViewportId = xamlViewportId
};
RhinoDoc.ActiveDocument.Add(myCurve, attribs);

2. DisplayPipeline

Create a custom Display Pipeline to draw your geometry, the sample below will show how.

Inside the PostDrawObject methods you can add this condition that will cause it to only show in the xaml viewport.

protected override void PostDrawObjects(DrawEventArgs e)
{
  if (e.Viewport.Id != xamlViewportId) return;
  // Call Draw methods
}

Oh… I see, Thanks CSykes, @csykes