I have a ETO UI with a viewportControl. I need the viewportControl camera to be set programatically, similar to rhino’s savedView user experience…
I managed to set the viewportControl’s viewport’s camera (location, direction and lens values) but I can’t figure out how I can refresh the viewport. In other projects I have used the RhinoView’s Redraw() method, but since I’m working with viewportControl, there is no RhinoView for “redrawing”.
How can I “refresh” or “redraw” the viewport of a viewportControl?
def onRestoreItemClick(self,sender,e): try: selectedIndex = self.viewListBox.SelectedIndex selectedView = self.viewModel.views[selectedIndex] self.vp.Viewport.SetCameraLocation(selectedView.location,False) self.vp.Viewport.SetCameraDirection(selectedView.direction,False) self.vp.Viewport.Camera35mmLensLength = seletectedView.lens self.vp.Refresh() #NO LUCK WITH REFRESH...THIS IS NO REDRAWING NOTHING except Exception as e: Rhino.RhinoApp.WriteLine(str(e))