Alternative Rotate View


#1

I am looking into an alternative to rhinoscriptsyntax rotateview, and need some help.

I thought this should work, but I get no error message, so I don’t understand where to start bugtracking.

    import Rhino
    
    strView=Rhino.Display.RhinoViewport()
    point=Rhino.Geometry.Point3d(0,0,0)
    vector=Rhino.Geometry.Vector3d(0,0,1)
    Rhino.Display.RhinoViewport.Rotate(strView, 10, vector, point)

(Steve Baer) #2

You are creating an instance of a new RhinoViewport and then adjusting values on that viewport instance. There is no error, it just isn’t really doing anything.

More likely, you’ll want to get a viewport from one that exists in the document. Something like

viewport = scriptcontext.doc.Views.ActiveView.ActiveViewport

I would recommend stepping into the RotateView function in rhinoscriptsytax to see what it does.


#3

Hi Steve,
How am I ever going to navigate this new Python++ universe… :smile:

Holomark2 is written mostly in rhinoscriptsyntax, and that works just fine, but due to the compiler issues I have I thought I could have a look at a “Rhino” function to see if that works better with the script compiler.

But this is too deep for me, I don’t even know where to search for the info I need to understand to understand what I need to understand… so I think I’ll wait for the compiler fix.