Site Tools

How to: Move Curve Grips


Summary: Demonstrates how to move a curve's grips.

The following example RhinoScript demonstrates how to move a curve's grip. In this case, we move it in the Z-axis direction by a distance of 1.0.

 Sub MoveCurveGrip
   Const rhCurve = 4
   Dim sCurve : sCurve = Rhino.GetObject("Select a curve", rhCurve)
   If IsNull(sCurve) Then Exit Sub
   Dim bGripsOn : bGripsOn = Rhino.ObjectGripsOn(sCurve)
   If (bGripsOn = False) Then
     bGripsOn = Rhino.EnableObjectGrips(sCurve, True)
   End If
   Dim aGrip : aGrip = Rhino.GetObjectGrip("Select a curve grip")
   If IsArray(aGrip) Then
     Dim aPt : aPt = aGrip(2)
     aPt(2) = aPt(2) + 1.0
     Rhino.ObjectGripLocation sCurve, aGrip(1), aPt
   End If
   If (bGripsOn = True) Then
     Rhino.EnableObjectGrips sCurve, False
   End If
 End Sub
developer/scriptsamples/movecurvegrip.txt ยท Last modified: 2020/08/14 (external edit)