Sel Linear Crv
Last changed: dale@mcneel.com-204.177.179.144

.
DeveloperRhinoScript
SummaryDemonstrates how to select linear and non-linear curves using RhinoScript.

Selecting Non-Linear Curves

The following RhinoScript subroutine will select all non-linear curves in the document:

  Sub SelNonLinearCrv
    Dim arrCurves, strCurve
    arrCurves = Rhino.ObjectsByType(4)
    If IsArray(arrCurves) Then
      Rhino.EnableRedraw False
      For Each strCurve In arrCurves
        If Not Rhino.IsCurveLinear(strCurve) Then
          Rhino.SelectObject strCurve
        End If
      Next
      Rhino.EnableRedraw True
    End If
  End Sub

Here is the toolbar button macro version of the above:

  _-NoEcho
  _-RunScript (
  arrCurves = Rhino.ObjectsByType(4)
  If IsArray(arrCurves) Then
  Rhino.EnableRedraw False
  For Each strCurve In arrCurves
  If Not Rhino.IsCurveLinear(strCurve) Then
  Rhino.SelectObject strCurve
  End If
  Next
  Rhino.EnableRedraw True
  End If
  strCurve = Null
  arrCurves = Null
  )

Selecting Linear Curves

The following RhinoScript subroutine will select all linear curves in the document:

  Sub SelLinearCrv
    Dim arrCurves, strCurve
    arrCurves = Rhino.ObjectsByType(4)
    If IsArray(arrCurves) Then
      Rhino.EnableRedraw False
      For Each strCurve In arrCurves
        If Rhino.IsCurveLinear(strCurve) Then
          Rhino.SelectObject strCurve
        End If
      Next
      Rhino.EnableRedraw True
    End If
  End Sub

Here is the toolbar button macro version of the above:

  _-NoEcho
  _-RunScript (
  arrCurves = Rhino.ObjectsByType(4)
  If IsArray(arrCurves) Then
  Rhino.EnableRedraw False
  For Each strCurve In arrCurves
  If Rhino.IsCurveLinear(strCurve) Then
  Rhino.SelectObject strCurve
  End If
  Next
  Rhino.EnableRedraw True
  End If
  strCurve = Null
  arrCurves = Null
  )