# Measure lenght of a curve between two point

## Recommended Posts

hello to all

Rhino question.

it is possible to make a lisp for :

Measure lenght of a curve between two point.

Thanks

##### Share on other sites

I posted this one a while back...

http://www.theswamp.org/index.php?topic=32677.0

##### Share on other sites

Does Rhino support the use of lisp? I thought it relied upon VBscript?

##### Share on other sites
Does Rhino support the use of lisp? I thought it relied upon VBscript?

Beats me. He said LISP, so that's what I provided.

##### Share on other sites

Alan. Don't give them what they ask for...give them what they need!

Maybe the OP can clear up the confusion.

##### Share on other sites

I found a paper written in 2004 that clearly mentions that Rhiniceros uses vbScript.

http://www.rhino3d.com/tutorials/vbscript/RhinoScript.pdf

##### Share on other sites
Alan. Don't give them what they ask for...give them what they need!

Maybe the OP can clear up the confusion.

LoL, noted.

I found a paper written in 2004 that clearly mentions that Rhiniceros uses vbScript.

http://www.rhino3d.com/tutorials/vbscript/RhinoScript.pdf

Well, that answers that question.

##### Share on other sites

This would be a RhinoScript version of that particular task:

```Option Explicit

Sub LenBetweenPts
Dim crv
Dim stParam, ndParam
Dim msg
Dim stpt, ndpt
Dim arrSubDomain(1), dblLen

With Rhino
crv = .GetObject("Pick a curve", 4)
.EnableRedraw False
If (VarType(crv) <> vbString) Then Exit Sub
stpt = .GetPointOnCurve (crv,  "Pick first Point:")
If Not IsArray(stpt) Then Exit Sub
stParam = .CurveClosestPoint(crv, stpt)

ndpt = .GetPointOnCurve (crv, "Pick next Point:")
If Not IsArray(ndpt) Then Exit Sub
ndParam = .CurveClosestPoint(crv, ndpt)

If stparam > ndparam Then
arrSubDomain(1) = stParam
arrSubDomain(0) = ndParam
Else
arrSubDomain(0) = stParam
arrSubDomain(1) = ndParam
End If

dblLen = Rhino.CurveLength(crv,, arrSubDomain)

If IsNumeric(dblLen) Then
msg = "Length between points: " & CStr(dblLen)
.Print msg
End If

.EnableRedraw True
End With
End Sub```

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.