为什么cage被改变后,cage所控制的物件没有变形?

Dim objRef As Rhino.DocObjects.ObjRef = Nothing
rc = Rhino.Input.RhinoGet.GetOneObject(“Select a control for editing”, False, Rhino.DocObjects.ObjectType.MorphControl, objRef)
If rc <> Rhino.Commands.Result.Success Then
Return rc
End If

        Dim obj As Rhino.DocObjects.RhinoObject = objRef.Object()
        If Nothing Is obj Then
            Return Rhino.Commands.Result.Failure
        End If

        obj.GripsOn = True
        doc.Views.Redraw()

        Dim grips() As Rhino.DocObjects.GripObject = obj.GetGrips()
        For i As Integer = 0 To grips.Length - 1
            Dim grip As Rhino.DocObjects.GripObject = grips(i)
            Dim dir As Rhino.Geometry.Vector3d = New Rhino.Geometry.Vector3d(0, 0, 1)
            dir.Unitize()
                ' Scale by our fixed distance
                dir *= 0.5
                ' Move the grip to a new location
                grip.Move(dir)
        Next i
        doc.Objects.GripUpdate(obj, False)
        doc.Views.Redraw()
        Return Rhino.Commands.Result.Success

@Jorin,請看一下這個問題,謝謝。

这个问题我自己已经解决,那么如果用vs在rhino中构建一个cage,我要用这个cage捕捉选定的objects,应该怎么做。

你好,在 RhinoCommon 中可以把 MorphControl 当作物件来操作,但具体它是控制哪个物件还是需要在 Rhino 中手工来完成,因为这部分工作都是在底层完成的, RhinoComm 中目前并没有相应的接口可以执行这个操作。如果有这方面的需求,可以参照下面的例子自己定义一个类似 cage 的功能,如果有能力的话,可以做到和 cage 的功能一样。
https://github.com/mcneel/rhino-developer-samples/blob/master/rhinocommon/cs/SampleCsCommands/SampleCsMoveGrips.cs

谢谢!