I am trying to get a database of distance from one origin to a number of destinaitons... How can I do this???
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 ...
I am trying to get a database of distance from one origin to a number of destinaitons... How can I do this???
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
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");
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
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
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.
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
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
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 10:34 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)