I am trying to limit the selection to either a closed planar curve or a planar surface. I have tried all sorts of combinations of different ways to set up the custom filter including more detailed if statements and try/except clauses, but none work correctly, either I can select some things that don’t fit the filter criteria or I can’t select some things that do… Haven’t found the right combination yet. Anyone have any pointers here?
def cp_filt(rhino_object, geometry, component_index):
a=(rs.IsSurface(geometry) and rs.IsSurfacePlanar(geometry))
b=(rs.IsCurvePlanar(geometry) and rs.IsCurveClosed(geometry))
return a | b
def TestFilter():
msg="Select closed planar curve or planar surface"
obj=rs.GetObject(msg,4+8,True,custom_filter=cp_filt)
print obj
Thx, --Mitch