Point3d not callable python because <str>

I am trying to script something, but I am doing something wrong. My Point3d is not callable. Do you might know what I am doing wrong?
Thanks in advance for your response.

20190114 problem point3d 00.gh (8.8 KB)

Hi
On line 17 your .origin parameter is returning a point3d describing the origin. By adding brackets afterwards you are trying to call it as if it were a method but it is just a non-callable parameter.
The error message also references line 22 as this is where you called your function.

1 Like

Do you might know what I am doing wrong in this one? I am trying to return the plane.
When trying to make it a vector with ‘rc.createvector’ it would not work either.

20190114 problem point3d 01.gh (6.3 KB)

what is the desired outcome? Are you trying to move a plane from the start point of a line to the end of the line?

1 Like

I want to understand why ‘rs.MoveObject’ is not working because when placed outside the definition ‘rs.MoveObject’ works.

I want to create a plane that aligns its x-axis along the curve,
and moved to another point.

Maybe you are looking for MovePlane?

1 Like

I’m not 100% sure why that is not working. I tend to either use rhinoscriptsyntax OR rhinocommon. I think mixing them creates some…confusion. here is a version in rhinocommon that mimics your approach. maybe this helps.

import Rhino

#Get the curve information you want..start point and midpoint?
crvStartPt = Rhino.Geometry.Curve.PointAt(crv, 0) # curve start point
crvMidDomain = crv.Domain.Mid #get the "t" value of the mid point of the curve
crvMidPt = Rhino.Geometry.Curve.PointAt(crv, crvMidDomain) # curve mid point

#set the desired alignment axes
PlaneXAxis = Rhino.Geometry.Vector3d(crvStartPt-crvMidPt) #vector from StartPt->MidPt of curve
PlaneYAxis = Rhino.Geometry.Vector3d(PlaneXAxis.X, 1, 0)

#place planes
planeMid = Rhino.Geometry.Plane(crvMidPt, PlaneXAxis, PlaneYAxis) #place a plane at the midpoint of the curve
planeDest = Rhino.Geometry.Plane(GridPts, PlaneXAxis, PlaneYAxis) #place a plane at the destination point
a = planeMid
b = planeDest

20190114 problem point3d 00_CAH.gh (7.5 KB)

1 Like

Hello,

first of all, functions are callable and only functions are callable. If F is a function you can call F().
a Plane.Origin is a property, not a function. So you cannot call Plane.Origin(new_pnt) to replace an origin of a plane.
Instead, you can set a new value to a property unless it’s not readonly.
Fortunately plane.Origin doesn’t seem to be readonly.
I think what you might try is simply this.

plane.Origin=new_pnt

rs.MoveObject didn’t work because the plane is already a Rhino.Geometry.Plane. rs.MoveObject takes an id(guid), a unique ID pointing to geoemtries put into ghdoc. I don’t know how to put planes to ghdoc and get an ID.

1 Like