Change curve seam while selecting curves

I’ve got a script where the user selects curves one by one. What I’d like to do is change the Curve seam to the point closest to where the user clicked to select that curve.

Is there a way to get the location of where you clicked while slecting an object using GetObject?

As an alternative I was thinking of using GetPoint instead and checking which Curve is closest to that point but then I’d have to loop through all curves in the document and that sounds like it quickly might get slow? This also sounds like it requires some extra work to get the same workflow and feedback as you get with selecting using GetObject.

Anybody did something like this before and can share their thoughts/experiences?

You might try GetCurveObject() which returns more information including where the click point was…

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

For objects other than curves you can use GetObjectEx() or GetObjectsEx()…

1 Like

Ooh, interesting. Learn something new every day. I’ll try this out!

It works, but not as great as I hoped. For instance it’s hard to be precise and click on the corner of a curve. Ideally it would be great if I could use the snap function which GetCurveObject doesn’t seem to support.

Well, if you don’t mind selecting the curve first, you can also use GetPointOnCurve() which does pay attention to object snaps.