I was trying to manipulate the detail viewport through rhino python, without avail. The viewport does not change. I tried
ZoomExtentsSelected, neither of them worked. I don’t know whether I am missing some steps. I am on Rhino 6.18.
Thanks for advices,
import Rhino import scriptcontext as sc import rhinoscriptsyntax as rs guid = rs.GetObject() obj = rs.coercerhinoobject(guid) #obj is the rhinoobject I want the viewport to zoom at newView = sc.doc.Views.AddPageView("newpageview", 200, 200) # add detail detail = newView.AddDetailView("test", Rhino.Geometry.Point2d(0,0), Rhino.Geometry.Point2d(200,200), Rhino.Display.DefinedViewportProjection.Top) bbox = obj.Geometry.GetBoundingBox(True) viewport = detail.Viewport print viewport.CameraTarget viewport.SetCameraTarget(bbox.Center, True) # move location print viewport.CameraTarget # the CameraTarget did changed detail.CommitChanges() sc.doc.Views.Redraw()