rs.GetPoint() won't accept a pasted coordinate but "_Point" will

Hi @dale, I use rs.GetPoint() to get a point (obviously) but sometimes I know the coordinate and have it copied to clipboard and want to paste that in instead, but that doesn’t work.

But this works for the command _Point, so I workaround this by first adding a point and then snapping to that with rs.GetPoint(). But that isn’t a smooth workaround, so could you add the ability to paste a coordinate for rs.GetPoint()?

Let’s say I want to use this coordinate in the script: 10080,20085,0

The strange thing is that if I type it in then it works, but if I paste it then I get this error message:
Unknown command: 119080,1191385,0

Please try it out with this super simple example

import rhinoscriptsyntax as rs
print rs.GetPoint()

(I have a system where I set up a reference point as a local origin for architecture, and I often want to copy this data to another file)

Hi @Holo,

Any better?

#! python 3
import Rhino
import scriptcontext as sc

def Test():
    rc, point = Rhino.Input.RhinoGet.GetPoint("Location of point object", False)
    if rc == Rhino.Commands.Result.Success:
        sc.doc.Objects.AddPoint(point)
        sc.doc.Views.Redraw()

if __name__ == "__main__":    
    Test()

– Dale

1 Like

Thanks, that works fine!

And if someone finds this, I changed it to:

rc, point = Rhino.Input.RhinoGet.GetPoint("Location of point object", False)
if not rc == Rhino.Commands.Result.Success:
    print ("Error: No valid point chosen")
    return False

Please see if you can update the rs.GetPoint to act in the same way.