Align camera with a curve

Hey all,

Is there any way to align the axis of a camera with a straight line that you preset? Is there a preexisting command or script available for this?

Thank you.


The below script will set the camera to the start of the selected curve and the target to the end of that curve:

import rhinoscriptsyntax as rs

line_id = rs.GetObject('select supposed line curve')
rs.ViewCameraTarget(camera = rs.CurveStartPoint(line_id) , target = rs.CurveEndPoint(line_id))

Does that help?


That’s awesome, Willem. Is there any way to turn it in to a Drag’n Drop Script that loads up at start up?

I would really appreciate it.

This might be of some help Running Python scripts from aliases or toolbar buttons

There’s also this now:

1 Like

Hey guys,
@Helvetosaur, @ Willem, and @Pascal,

Pascal helped me turn the “Align camera with a curve” script in to a drag’n drop rvb – which was great – it works well, except that when I open a new file the script seems to run automatically without my calling it the command line says “select supposed line curve” and then when I hit enter to dismiss it a Rhino 6 RhinoScript Error message displays saying “Type mismatch in parameter. String required. Line 13 Char 1.”

Can anyone help me figure out what’s causing this? Is it something in the script or something I’ve done in Options???

I’ve attached the rvb in case you want to look at it.CameraToCurve.rvb (453 Bytes)

Thank you guys



Hi Cosmas - sorry, a ‘thinko’ - remove or comment out the line that has

Call CameraToCurve()


Perfect, @Pascal, Thank you!