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 8 of 8

Multiple destinations from one origin??

This is a discussion on Multiple destinations from one origin?? within the MapPoint Desktop Discussion forums, part of the Map Forums category; I am trying to get a database of distance from one origin to a number of destinaitons... How can I ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    Multiple destinations from one origin??

    I am trying to get a database of distance from one origin to a number of destinaitons... How can I do this???

  2. #2
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60
    You need to do a little bit of coding.

    It is only a short program, but it has to create each route, then find the distance for that route, then save it to your database.


    Richard
    Winwaed Software Technology LLC
    http://www.winwaed.com
    See http://www.mapping-tools.com for MapPoint Tools

  3. #3
    Newbie_Nick is offline Junior Member White Belt
    Join Date
    Aug 2009
    Posts
    7

    Re: Multiple destinations from one origin??

    Quote Originally Posted by Winwaed View Post
    You need to do a little bit of coding.

    It is only a short program, but it has to create each route, then find the distance for that route, then save it to your database.

    Richard
    Simple enough
    But could you give an example as to how exactly that code would look?

    Thanks
    Nick

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Multiple destinations from one origin??

    Hi,

    This is a simple example. MP is the activeX component in this code:

    Code:
    Route route = MP.ActiveMap.ActiveRoute;
    route.Clear();
    
    FindResults addrResults = MP.ActiveMap.FindAddressResults(street, city, "", "", zipCode, country);
    object o = 1;
    Location loc = addrResults.get_Item(ref o) as Location;
    Waypoint wp = route.Waypoints.Add(loc, "Start");
    addrResults = MP.ActiveMap.FindAddressResults(street2, city2, "", "", zipCode2, country2);
    loc = addrResults.get_Item(ref o) as Location;
    wp = route.Waypoints.Add(loc, "End");
    
    route.Calculate();
    Console.WriteLine("Distance " + route.Distance + " km");

  5. #5
    Newbie_Nick is offline Junior Member White Belt
    Join Date
    Aug 2009
    Posts
    7

    Re: Multiple destinations from one origin??

    Thanks
    However it seems I rushed things - I don't have the ActiveX control registered at all.
    I installed Mappoint, ran Excel 2007, clicked on the developer tab and wanted to register a custom control since I didn't find the MapPoint ActiveX control. I found the Mappointcontrol.ocx file but when I click on it, I get the following message

    "The selected file does not contain an self-registering ActiveX controls"

    What am I doing wrong?
    Thanks

  6. #6
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Multiple destinations from one origin??

    Hi,

    I don't know how todo that with Excel, but other may help here. On the other hand it is also possible to use the object model wiithout the ActiveX. There are some examples for this here.

  7. #7
    Mattys Consulting's Avatar
    Mattys Consulting is offline Senior Member Black Belt
    Join Date
    Dec 2002
    Posts
    1,040

    Re: Multiple destinations from one origin??

    I think I've seen this before.
    The control in your directory is probably very small, like 50kb,
    when it's supposed 400-500kb.

    I suggest you delete the control and re-install MapPoint.

    Mike Mattys
    Mattys Consulting - Custom Programming

  8. #8
    Newbie_Nick is offline Junior Member White Belt
    Join Date
    Aug 2009
    Posts
    7

    Re: Multiple destinations from one origin??

    Delete which control?
    That's the trouble - I just installed Mappoint and I can't find the control at all

    Edit: Ha, found it. I had to add it to my VBA References
    Thanks for the help, anyway

    Best
    Nick
    Last edited by Newbie_Nick; 09-04-2009 at 11:34 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Multiple Stops
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 09-19-2009, 01:14 AM
  2. Help ........ Multiple Routes from One Origin
    By Tanya789 in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 11-26-2004, 12:50 PM
  3. I would like to store an origin and a destination ....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 06-22-2004, 08:35 AM
  4. Multiple DataSets?
    By bryker in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 02-25-2004, 11:34 AM
  5. Multiple Routes on 1 Map
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 09-10-2003, 10:45 PM

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