algorithmic modeling for Rhino
Hi,
I'm looking for a method to set the active viewport display mode in c#. Is this possible?
For example, I can read the active viewport's display mode by using this (below), but I have not been able to track down a method for setting the display mode, from a found state such as wireframe to a desired state, such as ghosted.
String viewname = doc.Views.ActiveView.ActiveViewport.DisplayMode.EnglishName;
Many thanks.
Tags:
Hi Tree,
This is python, but I think you will figure it out how to rewrite it in C#:
import Rhino
# all available display modes
dm = Rhino.Display.DisplayModeDescription.GetDisplayModes()
for item in dm:
print item.LocalName
# set display mode
rendered = Rhino.Display.DisplayModeDescription.FindByName("Rendered")
Rhino.RhinoDoc.ActiveDoc.Views.ActiveView.ActiveViewport.DisplayMode = rendered
# get the display mode of your active viewport
activeViewPortDm = Rhino.RhinoDoc.ActiveDoc.Views.ActiveView.ActiveViewport.DisplayMode.LocalName
print "\n%s" % activeViewPortDm
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by