Returns the previous grip index from a specified grip index of an object.
rhinoscriptsyntax.PrevObjectGrip (object_id, index, direction=0, enable=True)
rhinoscript.grips.PrevObjectGrip (object_id, index, direction=0, enable=True)
object_id |
Required. String or Guid. The identifier of the object. |
index |
Required. Number. The zero-based grip index from which to get the previous grip index. |
direction |
Optional. Number. The direction to get the previous grip index, either 0=U or 1=V. The default value is 0. Note, this argument only applies when dealing with surfaces. |
enable |
Optional. Boolean. If True (default), the previous grip index found will be selected. Otherwise, it will not be selected. |
Number |
The index of the next grip from the specified grip index. |
None |
If not successful, or on error. |
import rhinoscriptsyntax as rs
object_id = rs.GetObject("Select curve", rs.filter.curve)
if object_id:
rs.EnableObjectGrips(object_id)
count = rs.ObjectGripCount(object_id)
for i in range(count-1, 0, -2):
rs.PrevObjectGrip(object_id, i, 0, True)