Point Component - "Set One Point" script?

is it possible to see the actual code/script that it being used when a user right clicks on the Point component and selects “set one point”? The end result in Rhino is “Point Location (Type=Coordinate):” shown in the command line, but curious how it gets from A to B…

trying to implement said sub-code into a script to work with HumanUI that lets a user set a point coordinate in their rhino canvas and relay that point back into the GH script. Any other thoughts on how to do this successfully?

That is wrapped into pManager when you declare a component input. So pManager.AddPointParameter tells the component to have those options. I don’t think the set one or multiple points part is specifically accessible in the SDK but there should be someone that knows how to code it.

import rhinoscriptsyntax as rs

a=rs.GetPoint(message='Select alignment point')

Same idea, I’d like to be able to set a point without having to right click a point component. What I want to do is one click on a button.

I connected a button to the python component and once I have clicked the button but Rhino asks me to set a point and then it repeats once. Something must be wrong.

I’m sure @Willem knows how to fix this :slight_smile:

You can try this:
get point and get point on mesh.gh (6.8 KB)

I use sticky to avoid a second run of rs.Getpoint()
I also added a version with constrain on mesh

I hope it helps

Thank you @kieffer , this does almost exactly what I wanted.

The mouse isn’t recognized in the viewport and it basically requires two clicks. A first click to get into the viewport and a second click to get the point.

Yes , i d’ont know how to avoid it for the moment. I will try to find a solution

1 Like

hello @kieffer the script you defined is almost what I want, the only deference is that I want to select several points on the mesh in order to subsequently create a closed curve. can you help me to select several points

I change my account i didn’t saw your message before, Sorry for that.
Here is a version with multiple points:
get points.gh (6.5 KB)