Accessing SelBrushPoints points



I am trying to modify a section of a mesh and have just found the SelBrushPoints function. I would like the user when prompted to select the points on the mesh using this tool however I cannot seem to find how to use this tool in python. I can call the function using rs.Command( "_SelBrushPoints ") however I cant get the points that I have just selected.

Can anyone help?

(Dale Fugier) #2

I assume you mean the SelBrushPoints command, as there is no SelBrushPoints function in RhinoCommon or Rhino.Python.

There does not appear to be SDK access to the functionality provided by this command. But you can still get the selected grips and their locations:

import rhinoscriptsyntax as rs

def TestSelBrushPointLocations():
    objectId = rs.GetObject("Select mesh", rs.filter.mesh)
    if objectId is None: return

    rs.EnableObjectGrips(objectId, True)
    rs.Command("_-SelBrushPoints", False)

    grips = rs.SelectedObjectGrips(objectId)
    if grips:
        for index in grips:
            point = rs.ObjectGripLocation(objectId, index)
            if point:

if __name__ == "__main__":
    TestSelBrushPointLocations() # Call the function defined above


Wow, works perfectly!

Thanks for the help