MeshHideVertices

Returns or modifies the hidden vertices of a mesh object. Any mesh faces that reference hidden vertices will be hidden.

Note, hiding mesh vertices is a runtime setting only - hidden vertices are not saved in the 3dm file.

Syntax

Rhino.MeshHideVertices (strObject [, arrHidden])

Rhino.MeshHideVertices (strObject [, Null])

Parameters

strObject

Required.  String.  The object's identifier.

arrHidden

Optional.  Array.  An array of Boolean values indicating the hidden state (True = hidden, False = Visible). Note, for every mesh vertex, there must be a corresponding Boolean value.

Null

Optional.  Null.  Specifying Null will remove, or purge, any existing hidden vertex information from the mesh.

Returns

Array

If arrHidden is not specified,  the current hidden state if successful.

Array

If arrHidden is specified, the previous hidden state if successful.

Null

If strObject does not have hidden vertices, if not successful, or on error.

Example

Sub Test

  Dim strMesh, arrFaces, arrFace, arrIndices, arrHidden()

  Dim i, j

  strMesh = Rhino.GetObject("Select mesh", 32)

  If Not IsNull(strMesh) Then

    arrFaces = Rhino.GetMeshFaces(strMesh)

    If IsArray(arrFaces) Then

      ReDim arrHidden( Rhino.MeshVertexCount(strMesh)-1 )

      arrIndices = Rhino.MeshFaceVertices(strMesh)

      For i = 0 To UBound(arrHidden)

        arrHidden(i) = False

      Next

      For i = 0 To UBound(arrFaces)

        arrFace = arrIndices(arrFaces(i))

        For j = 0 to UBound(arrFace)

          arrHidden(arrFace(j)) = True

        Next

      Next

      Rhino.MeshHideVertices strMesh, arrHidden

    End If

  End If

End Sub

Also See

MeshHasHiddenVertices