Disable Pickstyle, RhinoGet

I need a RhinoGet , Input.Custom.GetObject to get a Surface / Face Selection only with a valid Pick-Position / u-v Parameters.

Can I somehow force the user to only select by clicking on the surface / Face ?
no window / cross selection, no _selID, _selName etc… ?

the _filletSrf Command has the behaviour I need.


thanks / kind regards -tom

Hi @Tom_P, this is the closest i could get, extracted from another script which allows single surfaces and sub-surfaces to be picked:

GetSurfaceByPicking.py (2.4 KB)

Note that it does not prevent the user from performing a window or crossing selection but keeps prompting if the selection is not from a mouse pick.

I could imagine a different method (using GetPoint) which shoots a ray from the camera location on all breps and then finds the surface and parameter. During GetPoint you cannot perform a window or crossing selection…


This is what I used to mimic FilletSrf behavior:

gs = Rhino.Input.Custom.GetObject(); gs.SubObjectSelect = True; 
gs.GeometryFilter = Rhino.DocObjects.ObjectType.Surface
gs.DeselectAllBeforePostSelect = True;  gs.AcceptNumber(True,False);  
gs.OneByOnePostSelect = True; gs.DisablePreSelect();

I might add that the documentation for Rhino Common is atrocious. Documentation is mostly either missing or wrong.
I spent many hours experimenting to find what works.
And when Help is requested, from what I have observed, that is worst than useless. Time and again I have observed those who make such requests will just be led off into the weeds on a wild goose chase. The only helpful responses are from other users.

Hi @jim,

When you find this, please let us know.


– Dale

Hi @Tom_P,

You might check ObjRef.SelectionPoint, which returns the point where the selection occurred. Otherwise, Point3d.Unset is returned.

ObjRef.SurfaceParameter is also a good method to use for checking.

But, GetObject.OneByOnePostSelect is probably what you’re looking for.

import Rhino

def test_pick_surface():
    go = Rhino.Input.Custom.GetObject()
    go.SetCommandPrompt("Select surface")
    go.GeometryFilter = Rhino.DocObjects.ObjectType.Surface
    go.OneByOnePostSelect = True
    if go.CommandResult() == Rhino.Commands.Result.Success:
        objref = go.Object(0)
        srf, u, v = objref.SurfaceParameter()
        if srf:
            print u, v
        pt = objref.SelectionPoint()
        print pt

if __name__ == "__main__":

– Dale

1 Like

thanks @dale
OneByOnePostSelect was the missing line / property, what I was after.

I think the RhinoCommon API is great and very powerful.

regarding the documentation for this specific case:

should have some hint to other similar keywords:
(selection, window, crossing, mouse…)

I was totally miss-led by the stuff i found…
then searched for similar keywords without success…


kind regards -tom