NEW: Welcome to the Rhino 6 version of this page! Looking for the older Rhino 5 version?

Viewport Resolution

Print Active Viewport Resolution

partial class Examples
{
  public static Result ViewportResolution(RhinoDoc doc)
  {
    var active_viewport = doc.Views.ActiveView.ActiveViewport;
    RhinoApp.WriteLine("Name = {0}: Width = {1}, Height = {2}",
      active_viewport.Name, active_viewport.Size.Width, active_viewport.Size.Height);
    return Result.Success;
  }
}
Partial Friend Class Examples
  Public Shared Function ViewportResolution(ByVal doc As RhinoDoc) As Result
	Dim active_viewport = doc.Views.ActiveView.ActiveViewport
	RhinoApp.WriteLine("Name = {0}: Width = {1}, Height = {2}", active_viewport.Name, active_viewport.Size.Width, active_viewport.Size.Height)
	Return Result.Success
  End Function
End Class
from scriptcontext import doc

activeViewport = doc.Views.ActiveView.ActiveViewport
print "Name = {0}: Width = {1}, Height = {2}".format(
    activeViewport.Name, activeViewport.Size.Width, activeViewport.Size.Height)