Jump to content
maksolino

Measure lenght of a curve between two point

Recommended Posts

maksolino

hello to all

Rhino question.

it is possible to make a lisp for :

Measure lenght of a curve between two point.

Thanks

Share this post


Link to post
Share on other sites
ReMark

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

Share this post


Link to post
Share on other sites
alanjt
Does Rhino support the use of lisp? I thought it relied upon VBscript?

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

Share this post


Link to post
Share on other sites
ReMark

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

 

Maybe the OP can clear up the confusion.:?

Share this post


Link to post
Share on other sites
alanjt
Alan. Don't give them what they ask for...give them what they need!:lol:

 

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 this post


Link to post
Share on other sites
SEANT

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

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...