"Between" point picking option in Python Common

Please show me how to write source code of the “Between” point picking option in Python Common.

there’s probably a better way but… :wink:

import rhinoscriptsyntax as rs

pt1 = rs.GetPoint('Pick first point')
pt2 = rs.GetPoint('Pick second point')
vector = rs.VectorCreate(pt2, pt1)
halfvec = rs.VectorDivide(vector, 2)
between = rs.PointAdd(pt1, halfvec)

# for visualization/testing purposes

Thank you, jeff

But, I want to write a program that return Rhino.Geometry.Point3d object to Rhino.Input.Custom.GetPoint class in RhinoCommon .

i don’t speak the Rhino.____ language…
those smart europeans will be waking up soon… they’ll know. :smile:

In that case it’s pretty much the same code but written with Rhinocommon methods and a custom display conduit to show where the ‘between point’ will end up by picking the start and end point.

Could you be a little bit more specific about what it is you are trying to achieve?


HI gootzans
You can use rs.coerce3dpoint () function guid convert to Rhino.Geometry

import rhinoscriptsyntax as rs
pt1 = rs.GetObject(“Pick first point”)
pt2 = rs.GetObject(“Pick second point”)
center_pt = rs.AddPoint(rs.VectorAdd(pt1,pt2)/2)
print type(center_pt)
obj_center = rs.coerce3dpoint(center_pt)
print type(obj_center)

Hi all,
Sorry, I description is not enough.
Because, because I do not speak English well.

I do not want to write a script to draw a point, want to write a script that returns a position to “Point” command and “Move” command.

Sorry gootzans, I really don’t understand what you would like to do!

Hi Gootzans,

What is your native language?

– Dale

Hi dale,

My native language is Japanese.

the code i provided only draws a point as a means to see where the point is… you can leave the last line out and use the between variable as the position to move from or move to. (or whatever else you may need to do with the coordinate)

@luna can you help find out what Gootzans is asking for?


– Dale

1 Like