I did an experiment to control the camera position and target position in GH, but after I click the button, the viewport only seems to run until the Y value of the target point changes. I still need to click enter in any input box in the view property bar to complete the change of all viewports (the values of the camera and target point in the view property bar are changed under program control)
I don’t know what’s wrong
import Rhino
import scriptcontext as sc
doc=Rhino.RhinoDoc.ActiveDoc.Views.ActiveView.ActiveViewport
if set==True:
new_camera_location = Rhino.Geometry.Point3d(1000, 1000, 1000)
new_target_location = Rhino.Geometry.Point3d(0, 0, 0)
set_active_view=doc.SetCameraLocation(new_camera_location,False)
set_active_target=doc.SetCameraTarget(new_target_location,False)
Rhino.DocObjects.DetailViewObject.CommitViewportChanges()
# sc.doc.Views.Redraw()
