@MClare, yes, below is an example which limits selection to objects having their object name start with “0.”
import rhinoscriptsyntax as rs
def DoSomething():
# limit selection to points with a custom name filter
ids = rs.GetObjects("Select", 1, False, False, False, custom_filter=my_filter)
if not ids: return
for id in ids:
print rs.ObjectName(id)
def my_filter(rhino_object, geometry, component_index):
# only allow objects with a name starting with "0."
if rhino_object.Attributes.Name.startswith("0."):
return True
return False
if __name__=="__main__":
DoSomething()
I think yes. It is based on the CustomGeometryFilter method which has 3 parameters. You can however use as many global variables in your custom_filter function as you like and define them before using rs.GetObjects
in your main routine.
Just format your python code like this:
```python
print "hello world"
```
c.