Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

Using more than one filter with RhinoGet.GetOneObject

$
0
0

@Colby_Evans wrote:

Not sure if I am not looking in the correct place, but I have not seen anything that can show me how to utilize more than one filter for RhinoGet.GetOneObject()

This is one of the methods that I have tried, and it only takes the first filter as precedence; the other method I made a tuple, that wasn’t able to be passed. Then I am also not sure how to have multiple object types inside of Rhino.Input.Custom.GetObjectGeometryFilter

Any help will be appreciated.

def selectEdge(self):
filter = Rhino.DocObjects.ObjectType.Curve or Rhino.DocObjects.ObjectType.Annotation
objects = Rhino.Input.RhinoGet.GetOneObject(“Select Edge, or Annotation”, False, filter)

if objects[1].Curve():
    objRefGuid = objects[1].ObjectId
    objRef = objects[1].Curve()
    objRefName = rs.ObjectName(objRefGuid)

    return objRefGuid, objRef, objRefName

if objects[1].TextEntity():
    objRefGuid = objects[1].ObjectId
    objRef = objects[1].TextEntity()
    objRefName = rs.ObjectName(objRefGuid)

    return objRefGuid, objRef, objRefName

rs.UnselectAllObjects()

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles