Click or drag to resize

RhinoViewportSize Property

Gets or sets the height and width of the viewport (in pixels)

Namespace:  Rhino.Display
Assembly:  RhinoCommon (in RhinoCommon.dll)
Syntax
public Size Size { get; set; }

Property Value

Type: Size
Examples
using Rhino;
using Rhino.Commands;

namespace examples_cs
{
  public class ViewportResolutionCommand : Command
  {
    public override string EnglishName { get { return "csViewportResolution"; } }

    protected override Result RunCommand(RhinoDoc doc, RunMode mode)
    {
      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;
    }
  }
}
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)
Version Information

Rhino for Mac

Supported in: 5.4

Rhino for Windows

Supported in: 6.6
See Also