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

Mark Points on a Line

Demonstrates how to mark points on a line using RhinoScript.

VBScript

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' MarkLine.rvb -- March 2010
' If this code works, it was written by Dale Fugier.
' If not, I don't know who wrote it.
' Works with Rhino 4.0.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub MarkLine()
  Dim arrLast
  Call Rhino.Command("_Line _Pause _Pause")
  If (Rhino.LastCommandResult() = 0) Then
    Call Rhino.EnableRedraw(False)
    arrLast = Rhino.LastCreatedObjects()
    If IsArray(arrLast) Then
      Call Rhino.AddPoint(Rhino.CurveStartPoint(arrLast(0)))
      Call Rhino.AddPoint(Rhino.CurveMidPoint(arrLast(0)))
      Call Rhino.AddPoint(Rhino.CurveEndPoint(arrLast(0)))
      Call Rhino.DeleteObjects(arrLast)
    End If
    Call Rhino.EnableRedraw(True)
  End If
End Sub

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Call Rhino.AddStartupScript(Rhino.LastLoadedScriptFile)
Call Rhino.AddAlias("MarkLine", "_NoEcho _-RunScript (MarkLine)")