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

Create a new floating viewport and change its display mode

$
0
0

@Dongyeop_Lee wrote:

I’m trying to create a python code using RhinoCommon to do multiple Rhino commands at once.

  1. NewFloatingViewport Projection Perspective
  2. MaxViewport
  3. Zoom Extents
  4. SetDisplayMode Mode Shade

I think the following code makes it to step 2, MaxViewport, but I can’t seem to complete the rest quickly. Can someone help? I don’t want to use rhinoscriptsyntax.Command(), because it made my Grasshopper file very unstable executing multiple commands.

import rhinoscriptsyntax as rs
import Rhino
import System
from scriptcontext import doc

if r:
    newView = Rhino.RhinoDoc.ActiveDoc.Views.Add("Test", Rhino.Display.DefinedViewportProjection.Perspective, System.Drawing.Rectangle(0, 0, 600, 600), True)
    newView.Maximized = True

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles