Finds the object that is closest to a test point.
Rhino.PointClosestObject (arrPoint, strObject)
Rhino.PointClosestObject (arrPoint, arrObjects)
arrPoint |
Required. Array. The 3-D test point. |
strObject |
Required. String. The identifier of a point, point cloud, curve, surface, polysurface, or mesh object to test against. |
arrObjects |
Required. Array. The identifiers of one or more point, point cloud, curve, surface, polysurface, or mesh object to test against. |
Array |
An array containing the results of the closest point calculation if successful. The elements of the array are as follows:
|
|||||||||
Null |
If not successful, or on error. |
Dim arrObjects, arrPoint, arrResults
arrObjects = Rhino.GetObjects("Select target objects for closest point", 63)
If IsArray(arrObjects) Then
arrPoint = Rhino.GetPoint("Test point")
If Not IsNull(arrPoint) Then
arrResults = Rhino.PointClosestObject(arrPoint, arrObjects)
If IsArray(arrResults) Then
Rhino.Print "Object id: " & CStr(arrResults(0))
Rhino.AddPoint arrResults(1)
End If
End If
End If