import rhinoscriptsyntax as rs
a = rs.ViewNames()
b = rs.NamedViews()
In c#, I wrote the following.
var activeView = Rhino.RhinoDoc.ActiveDoc.Views.ActiveView.ActiveViewport.Name;
var view = Rhino.RhinoDoc.ActiveDoc.Views;
var namedViews = Rhino.RhinoDoc.ActiveDoc.NamedViews;
A = activeView;
B = view;
C = namedViews;
The active viewport of A is output as a String, but B, C are output as Rhino.DocObjects.Tables.ViewTable.
Can this be changed to String?
I would like to get a list of default views and NamedViews.
I combined the two replies and wrote the following.
List<string> viewAsString = new List<string>();
var views = Rhino.RhinoDoc.ActiveDoc.Views.GetViewList(true, false);
var namedViews = Rhino.RhinoDoc.ActiveDoc.NamedViews;
foreach(var v in views)
{
viewAsString.Add(v.ActiveViewport.Name);
}
foreach(var nv in namedViews)
{
viewAsString.Add(nv.Name);
}
A = viewAsString;
I was able to get a list of Views and NamedViews.
Thank you very much!