CurrentView Fails when switching from Named View


I am having problems switching from a Named View to a Perspective View. I’ve pasted sample python code below. The code sucessfully creates a named view called DrawView and set’s it as the current view but fails when I try to switch back to Perspective.

Thanks in advance for the help.

import rhinoscriptsyntax as rs

#Add Named View called “DrawView”
#Set View to DrawView
#Set View to Perspective
#Check to see if view is Perspective


Hi @eric.bunn,

The rs.CurrentView method sets the current view based on a title (string) you pass to the function. The function then iterates the views looking for a view named “title”.


This restores a named view named “DrawView” and renames the view as well. Thus, you no longer have a view named “Perspective”. This is why the subsequent call to rs.CurrentView fails.

Hope this helps.

– Dale