developer:scriptsamples:selcurve


Select Linear and Non-linear Curves

Developer: RhinoScript
Summary: Demonstrates 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.IsCurveL
       inear(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
)


developer/scriptsamples/selcurve.txt · Last modified: 2010/03/03 10:01 by dale Driven by DokuWiki Recent changes RSS feed

 © 1997-2012 

McNeel North America Europe Latin AmericaAsia