Click or drag to resize

RhinoPageViewPageIsActive Property

true if the page is active instead of any detail views. This occurs when the MainViewport.Id == ActiveViewportID.

Namespace:  Rhino.Display
Assembly:  RhinoCommon (in RhinoCommon.dll)
public bool PageIsActive { get; }

Property Value

Type: Boolean
partial class Examples
  public static Rhino.Commands.Result ActiveViewport(Rhino.RhinoDoc doc)
    Rhino.Display.RhinoView view = doc.Views.ActiveView;
    if (view == null)
      return Rhino.Commands.Result.Failure;

    Rhino.Display.RhinoPageView pageview = view as Rhino.Display.RhinoPageView;
    if (pageview != null)
      string layout_name = pageview.PageName;
      if (pageview.PageIsActive)
        Rhino.RhinoApp.WriteLine("The layout {0} is active", layout_name);
        string detail_name = pageview.ActiveViewport.Name;
        Rhino.RhinoApp.WriteLine("The detail {0} on layout {1} is active", detail_name, layout_name);
      string viewport_name = view.MainViewport.Name;
      Rhino.RhinoApp.WriteLine("The viewport {0} is active", viewport_name);
    return Rhino.Commands.Result.Success;
import Rhino
import scriptcontext

def ActiveViewport():
    view = scriptcontext.doc.Views.ActiveView
    if view is None: return
    if isinstance(view, Rhino.Display.RhinoPageView):
        if view.PageIsActive:
            print "The layout", view.PageName, "is active"
            detail_name = view.ActiveViewport.Name
            print "The detail", detail_name, "on layout", view.PageName, "is active"
        print "The viewport", view.MainViewport.Name, "is active"

if __name__ == "__main__":
Version Information

Rhino for Mac

Supported in: 5.4

Rhino for Windows

Supported in: 6.2
See Also