Setting view to a plane (rhinocommon)

I would like to be able set the current view to a view based on a plane I have the geometry for. How can I do this?

From a post I saw by menno, I’m getting it has something to do with viewtable.add, but I’m not having much luck on this one. Please help?

Thanks,
Sam

Does this help:

protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
  Rhino.Display.RhinoView view = doc.Views.ActiveView;
  if (null != view)
  {
    Rhino.Geometry.Plane plane = Rhino.Geometry.Plane.WorldZX;
    view.ActiveViewport.SetToPlanView(plane.Origin, plane.XAxis, plane.YAxis, true);
    view.Redraw();
  }
  return Result.Success;
}

If you want to (also) set the cplane, set the true to false…

3 Likes

Perfect, thanks!
Sam