Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 5 of 5

return the waypoint arrival time

This is a discussion on return the waypoint arrival time within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hello Everyone, I am working with a set of waypoints in VBA. I am collecting the waypoint order and am ...

  1. #1
    CSG
    CSG is offline Junior Member White Belt
    Join Date
    Mar 2004
    Location
    Dover, PA
    Posts
    9

    return the waypoint arrival time

    Hello Everyone,

    I am working with a set of waypoints in VBA. I am collecting the waypoint order and am preparing to update my Access database. I have recorded the stop order and can recover the itineray line with this code:

    MsgBox (objmap.ActiveRoute.Waypoints.Item(stop).name & " -" & objmap.ActiveRoute.Waypoints.Item(stop).PreferredA rrival)

    but there does not seem to be a way to return the time for that waypoint.

    has anyone figured out how to get that data?

    PS (objmap.ActiveRoute.Directions.Item(stop).Preferre dArrival) returns 12:00 PM by default but does not return the calculated arrival time.



    Thanks for your help
    Randye
    CSG

  2. #2
    CSG
    CSG is offline Junior Member White Belt
    Join Date
    Mar 2004
    Location
    Dover, PA
    Posts
    9

    error in post

    this line returns the first driving direction for the waypoint.

    MsgBox (objmap.ActiveRoute.Directions.Item(stop).instruct ions)


    Randye
    CSG

  3. #3
    CSG
    CSG is offline Junior Member White Belt
    Join Date
    Mar 2004
    Location
    Dover, PA
    Posts
    9

    starttime for a waypoint

    Found it

    MsgBox (objmap.ActiveRoute.Waypoints.Item(stop).name & " -" & objmap.ActiveRoute.Directions.Item(stop).StartTime )


    Randye
    CSG

  4. #4
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    This is great, but exactly what is "stop"?

    I am having a tough time identifying the direction instruction that correalates to the waypoint.

  5. #5
    CSG
    CSG is offline Junior Member White Belt
    Join Date
    Mar 2004
    Location
    Dover, PA
    Posts
    9

    Retrieving Time and Distance

    Hello,

    This VBA code reads the directions created by mappoint and updates a table in ms access s= directions counter and stops = waypoint item
    I hope this will answer your question.


    Private Sub WAYPOINT_Click()

    On Error GoTo err_wp_CLICK

    Dim objMap As MapPoint.Map
    Set objMap = Forms!MAPPLAN.csgmAP.ActiveMap
    Dim objLoc As MapPoint.location
    Dim objpushPin As MapPoint.Pushpin
    Dim na As String
    Dim ti As Date
    Dim s As Integer
    Dim STOPS As Integer
    Dim last As Integer
    Dim mi As String

    STOPS = 1
    last = objMap.ActiveRoute.directions.count
    s = 1
    DoCmd.SetWarnings False
    DoCmd.OpenQuery "gpsclearroute"

    loopstops:
    na = objMap.ActiveRoute.Waypoints.Item(s).name
    ti = objMap.ActiveRoute.directions.Item(STOPS).StartTim e
    If objMap.ActiveRoute.directions.Item(STOPS).Distance = 0 Then mi = 0 Else mi = Format(CDbl(objMap.ActiveRoute.directions.Item(STO PS).Distance), "#.#")
    'MsgBox (s & "--" & na & " -- Dir: " & STOPS & " -- Time: " & ti & " -- TURNS: " & di)
    If mi = "." Then Me!mi = 0 Else Me!mi = mi
    Me!wp = s
    Me!ti = ti
    Me!na = na
    Me!st = STOPS
    Me!di = di
    di = objMap.ActiveRoute.directions.Item(STOPS).instruct ion & " for " & Me!mi & " miles"
    Me!wa = objMap.ActiveRoute.Waypoints.Item(s).StopTime * 1440
    Me!arr = (objMap.ActiveRoute.Waypoints.Item(s).PreferredArr ival)
    DoCmd.OpenQuery "gpsbuildroute"
    If STOPS >= last Then GoTo display
    STOPS = STOPS + 1
    If na <> objMap.ActiveRoute.directions.Item(STOPS).WAYPOINT .name Then s = s + 1
    If STOPS <= last Then GoTo loopstops

    display:
    DoCmd.OpenQuery "gpsrouteend"
    DoCmd.OpenQuery "makegpstemp"
    DoCmd.OpenQuery "gpsplotupdate"
    DoCmd.SetWarnings True
    Dim stDocName As String
    Dim stLinkCriteria As String
    stDocName = "poproute"

    'stLinkCriteria = "[route]=" & "'" & Me![mname] & "'"
    DoCmd.OpenForm stDocName, , , stLinkCriteria
    err_wp_CLICK:

    End Sub


    CSG

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Driving time between each waypoint
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-10-2005, 06:42 AM
  2. Adjusting preferred arrival setting
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 14
    Last Post: 03-03-2005, 01:43 PM
  3. Specifying stop time of new waypoint
    By stephenmillington in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 06-09-2004, 10:08 AM
  4. Return surrounding Zip Codes
    By johnweidauer in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 02-11-2004, 05:58 PM
  5. Planning a route after arrival times
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 02-24-2003, 08:11 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96