NEW: Welcome to the Rhino 6 version of this page! Looking for the older Rhino 5 version?

Select Planar Meshes

Demonstrates how to select mesh objects that are planar using RhinoScript.

VBScript

Sub SelPlanarMeshes
  Const rhMesh = 32
  Dim arrMeshes, arrVertices, i
  arrMeshes = Rhino.ObjectsByType(rhMesh)
  If IsArray(arrMeshes) Then
    Rhino.EnableRedraw vbFalse
    For i = 0 To UBound(arrMeshes)
      arrVertices = Rhino.MeshVertices(arrMeshes(i))
      If Rhino.PointsAreCoplanar(arrVertices) Then
        Rhino.SelectObject arrMeshes(i)
      End If
    Next
    Rhino.EnableRedraw vbTrue
  End If
End Sub