Get Camera position of saved views

How can I get camera position of two saved views?

I tried this but it does not work as it takes only active view:

private void RunScript(string view0, string view1, object y, ref object A, ref object B)
    Rhino.Display.RhinoView viewport0 = Rhino.RhinoDoc.ActiveDoc.Views.Find(view0, false);
    Rhino.Display.RhinoView viewport1 = Rhino.RhinoDoc.ActiveDoc.Views.Find(view1, false);

    A = viewport0.ActiveViewport.CameraLocation;
    B = viewport1.ActiveViewport.CameraLocation;
  } (7.5 KB)
Saveviews.3dm (61.4 KB)

1 Like

Iā€™m not at a computer currently but what if you set the viewport to the named views iterativly and collect the camera locations?

1 Like

Rhino.DocObjects.Tables.NamedViewTable viewportinfo = Rhino.RhinoDoc.ActiveDoc.NamedViews;


So helpful!! thanks