Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

Get viewport name as String with c#

$
0
0

How do I get the name of the viewport in c#?
I am working on a grasshopper plugin and would like to write it in c#.


GetViewNames.gh (11.3 KB)

In the case of python

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.

Thank you very much.

4 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles