Defining a Plane in RhinoScript

Very new to using Rhino script. I cannot get the following code to run.

Dim arrPlane(3)
arrPlane(0) = Array(0.0, 0.0, 0.0) ’ origin point
arrPlane(1) = Array(1.0, 0.0, 0.0) ’ x-axis vector
arrPlane(2) = Array(0.0, 1.0, 0.0) ’ y-axis vector
arrPlane(3) = Array(0.0, 0.0, 1.0) ’ z-axis vector

I keep getting the error “SyntaxError: unexpected token ‘arrPlane’”. This code is literally copied from the Rhino IronPython help. Any thoughts would be appreciated.

Hi Mike,

The above block of code seems to be formatted correctly. Are you passing this array to a function when you get the error?

– Dale

@mgags,

the code above is not python but RhinoScript (vb). So you get that error from the python editor. If you want to run this from the RhinoScript (vb) editor, use _EditScript and paste / run your code there.

To create a plane in python, the code should be similar though. Eg. to create the WorldXY plane you might just use this instead:

import rhinoscriptsyntax as rs
plane = rs.WorldXYPlane()

or to define a plane from 3 different point tuples use:

import rhinoscriptsyntax as rs
origin = (0.0, 0.0, 0.0)
x_axis = (1.0, 0.0, 0.0)
y_axis = (0.0, 1.0, 0.0)
plane = rs.PlaneFromPoints(origin, x_axis, y_axis)

note that these two examples only run from within the python editor, opened using _EditPythonScript

c.

Thanks a lot, this helped with my problem.