Forgot password?

Create an account!

Forum

« back

RhinoScript – PointArrayClosestPoint

Messages

Please log in to write a message.

  • 2. Hanno (Dec 19, 2009 13.28):

    Hi Julius,

    if you still need an answer:

    Looks like the problem is that you are trying to use pointarrayclosestpoint with an array of point object ids (don't know what your arrParameters contains, but you are using "pointcoordinates" later). pointarrayclosestpoint needs an array of XYZ-points, not rhino point objects.

    Regards

    Hanno

  • 1. julsen (Dec 10, 2009 19.54):

    Hi everybody,
    I have some problems with the command Rhino.PointArrayClosestPoint.
    I want to get the closest point of a point array to my test point and check whether or not the point is situated in a defined radius arround the point of the array. For example between 2 an 6 "meters".
    The point should be erased if it´s outside the radius of 6 meters or inside of 2 meters.
    I tried to write this function but there´s always an error on the line:

    index = Rhino.PointArrayClosestPoint (arrParameter, arrEnd)



    Function GetDistance(arrEnd, arrParameter, strEnd)
    Dim arrPt1, arrPt2
    Dim dist
    Dim index


    index = Rhino.PointArrayClosestPoint (arrParameter, arrEnd)
    If IsNumeric(number) Then

    arrPt1 = Rhino.PointCoordinates(arrParameter(index))
    dist = Rhino.Distance(arrPt1, arrEnd)
    If dist < 2 Or dist > 6 Then
    Rhino.DeleteObject strEnd
    Else
    Rhino.AddLine arrStart, arrEnd
    End If
    End If

    End Function


    I don`t now how the command works correctly.
    If somebody has got an answer I would be very pleased.

    Thanks Julius

Recommend

Why are these buttons gray?