Jump to content

GetDistAtPoint and einvalidinput error


kunekainen

Recommended Posts

Hi there;

 

I'm trying to find distance of a specified point on a 3d polyline with "getdistatpoint" function. sometimes it works properly but sometimes it gives einvalidinput error.

 

I searched web and found this function:

 

   Public Shared Function GetDistanceToPoint(curve As Curve, pt As Point3d) As Double
       Dim ptOnCurve As Point3d = curve.GetClosestPointTo(pt, False)
       Dim ptparam As Double = curve.GetParameterAtPoint(ptOnCurve)
       Dim a As Double = curve.GetDistanceAtParameter(ptparam)
       Dim b As Double = curve.GetDistanceAtParameter(curve.StartParam)
       Return a - b
   End Function

 

This works better than "getdistatpoint" function but it gives "einvalidinput" error too.

 

I really need help, thanks in advance.

Link to comment
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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...