I know it has been a while but I’m just looking back at this post and trying to get it to work again.
But I really cant figure this one out.
I’ve changed it too:
Dim refs As Rhino.DocObjects.ObjRef() = Nothing
Dim rc As Result = Rhino.Input.RhinoGet.GetMultipleObjects("Select points", False, DocObjects.ObjectType.MeshVertex, refs)
If rc <> Rhino.Commands.Result.Success Then
Return rc
End If
I don’t PointsOn because I select them directly on the mesh. Then I got those points in refs.
So I can
For Each Ref In Refs
Next
But do I need to get the “Mesh” itself also?
So I know that the MeshVertexes are from that object?
and how do i refer to objRef.Componentindex? or do you mean ref.GeometryComponentIndex? and how does this one work? Because I can only get ComponentIndexType out of that.
I know it are a lot of questions. Sorry for that.
Found another post where it says:
For Each ref In refs
Dim ci As ComponentIndex = ref.GeometryComponentIndex
If ci.ComponentIndexType = ComponentIndexType.MeshVertex Then
Dim vi As Integer = ci.Index
Dim vertex = m.Vertices(vi)
ElseIf ci.ComponentIndexType = ComponentIndexType.MeshTopologyVertex Then
Dim ti As Integer = ci.Index
Dim vertex = m.TopologyVertices(ti)
End If
Next
where Dim m As Rhino.Geometry.Mesh = mesh.Mesh
but this is about a mesh and i want to delte grip-points in a mesh
So to have it all in 1 what I have but then I have to select the mesh and then the points:
Dim mesh As Rhino.DocObjects.ObjRef = Nothing
Dim rc As Result = Rhino.Input.RhinoGet.GetOneObject("Select points", False, DocObjects.ObjectType.Mesh, mesh)
If rc <> Rhino.Commands.Result.Success Then
Return rc
End If
Dim refs As Rhino.DocObjects.ObjRef() = Nothing
Dim rc2 As Result = Rhino.Input.RhinoGet.GetMultipleObjects("Select points", False, DocObjects.ObjectType.MeshVertex, refs)
If rc2 <> Rhino.Commands.Result.Success Then
Return rc2
End If
Dim m As Rhino.Geometry.Mesh = mesh.Mesh
For Each ref In refs
Dim ci As ComponentIndex = ref.GeometryComponentIndex
If ci.ComponentIndexType = ComponentIndexType.MeshVertex Then
Dim vi As Integer = ci.Index
Dim vertex = m.Vertices(vi)
ElseIf ci.ComponentIndexType = ComponentIndexType.MeshTopologyVertex Then
Dim ti As Integer = ci.Index
Dim vertex = m.TopologyVertices(ti)
End If
Next
But now the deleting part