Results 1 to 3 of 3

Thread: calculate the Length off a polyline from begin till a point

  1. #1
    Vrijbuiter Guest

    calculate the Length off a polyline from begin till a point

    I want to know the length of a line from the begin till the point where
    I click or where the line cross a other line.
    I can get the line and i can find where the intersection points are
    with VBA but I can NOT find a function that calculate the the exact
    length from begin to the intersection.
    Can anyone help me to find the good way.


    Thanks,

    Alexander
    Holland

  2. #2
    Wyatt Earp Guest
    What you want is the distance between the intersection point and one of
    the endpoints of the line segment.

    Assuming the intersection point's coordinates are given by
    ix and iy and the line segment's endpoint coordinates are given by ex
    and ey the distance d would be:

    d = Sqrt(((ix-ex)*(ix-ex))+((iy-ey)*(iy-ey)))

    I'm not sure if Sqrt() is a valid VBA function, I typically use a C#
    over the VBA API, but the math is correct.




    Vrijbuiter wrote:
    I want to know the length of a line from the begin till the point
    where
    I click or where the line cross a other line.
    I can get the line and i can find where the intersection points are
    with VBA but I can NOT find a function that calculate the the exact
    length from begin to the intersection.
    Can anyone help me to find the good way.


    Thanks,

    Alexander
    Holland

  3. #3
    Vrijbuiter Guest
    Dear Wyatt Earp

    Thanks for your answer.
    The function you use call at visual basic -> CalculateSquareRoot =
    Sqr(NumberArg)
    But the problem is that a polyline not a strait line but a combination
    of more line's and arc's is, so I hope you see my problem.

    Alxander
    >From Holland

Similar Threads

  1. Replies: 1
    Last Post: 04-12-2005, 12:33 PM
  2. vba calculate length of line selected help
    By johnbortoli in forum VBA
    Replies: 1
    Last Post: 03-03-2005, 11:48 PM
  3. Length of a Polyline
    By Jeff Clark in forum Customization
    Replies: 6
    Last Post: 01-10-2005, 07:19 PM
  4. Calculate point loads using Cosmos works
    By JASON LONGLEY in forum SolidWorks
    Replies: 1
    Last Post: 12-15-2004, 07:02 PM
  5. Polyline Length
    By viswanathan in forum AutoCAD
    Replies: 1
    Last Post: 11-08-2004, 10:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other forums: Access Forum - Microsoft Office Forum - Exchange Server Forum