Unexpected token 'XAxis'

Hello,

I am trying to redraw a circle I generated previously. I saved the plane, but I kept getting the error message "unexpected token ‘XAxis’ "

Find my code below;

rs.AddCircle(Origin=3.11261784461494,12.4843662480556,1.79156261863619 XAxis=0,0.958394482307735,-0.285447046371282, YAxis=-0.96875335366118,0.0707983139213185,0.237706833128784, ZAxis=0.248026086874379,0.276527783464858,0.928447868865989,2)

Error below;

rs.AddCircle(Origin=3.11261784461494,12.4843662480556,1.79156261863619 XAxis=0,0.958394482307735,-0.285447046371282, YAxis=-0.96875335366118,0.0707983139213185,0.237706833128784, ZAxis=0.248026086874379,0.276527783464858,0.928447868865989,2) ^ SyntaxError: unexpected token 'XAxis'

@Helvetosaur

You might want to look at the Help for rhinoscriptsyntax for these kinds of things…

https://developer.rhino3d.com/api/RhinoScriptSyntax/#collapse-AddCircle

First, rs.AddCircle() wants either a plane or a point as the center, and a radius. :

image

From what you posted above, I assume you want to use a plane. In that case you need to create it - it is not implicit. The closest I could come is rs.PlaneFromFrame() which wants the origin (a 3D point), X and Y axes (3D vectors). Z axis is not needed.

rhinoscriptsyntax will automatically try to parse a list of 3 numbers into either a 3D point or vector, so your code could look like this:

import rhinoscriptsyntax as rs

plane=rs.PlaneFromFrame([3.11261784461494,12.4843662480556,1.79156261863619],[0,0.958394482307735,-0.285447046371282],[-0.96875335366118,0.0707983139213185,0.237706833128784])

rs.AddCircle(plane,2.0)

Why do you need all those digits?

A more readable way might be this:

import rhinoscriptsyntax as rs

origin=rs.coerce3dpoint([3.11261784461494,12.4843662480556,1.79156261863619])
x_axis=rs.coerce3dvector([0,0.958394482307735,-0.285447046371282])
y_axis=rs.coerce3dvector([-0.96875335366118,0.0707983139213185,0.237706833128784])

plane=rs.PlaneFromFrame(origin,x_axis,y_axis)
rs.AddCircle(plane,2.0)