Community of VE/MapPoint Users and Developers
This is a discussion on Looping Vertices within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Any body has a sample C# code to loop through the vertices of freeform shape? I'm not C# guru and ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Re: Looping Vertices
I'd recommend Chandu Thota's "Programming MapPoint in .NET". I haven't tried it (yet), but pg.108 has the following code: object[] vertices = shape.Vertices as object[]; foreach(object vertex in vertices) { MapPoint.Location loc = vertex as MapPoint.Location; } Richard
__________________ Winwaed Software Technology LLC http://www.winwaed.com See http://www.mapping-tools.com for MapPoint Tools Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009 |
| |||
| Re: Looping Vertices
Thanks, Richard. I test it and your sample code works fine. I fingured out the shape vertices is actual a COM object, I used following way to solve the problem. Silly but works. Object obj = shape.Vertices; Type thisType = obj.GetType(); object[] args = new object[1]; int numEntries = (int)thisType.InvokeMember("Length", BindingFlags.GetProperty, null, obj, null); if (numEntries > 0) { for (int j = 0; j < numEntries; j++) { args[0] = j; objLoc[j] = (MapPoint.Location)thisType.InvokeMember("GetValue ", BindingFlags.InvokeMethod, null, obj, args); } } |
![]() |
| Tags |
| looping, vertices |
| ||||
| Posted By | For | Type | Date | |
| Delphi Address Verifier - MapPoint Articles - MP2K Magazine | This thread | Refback | 03-18-2007 07:34 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Looping through Vertices of PolyLine? | OOT | MapPoint 2006/2009 Discussion | 3 | 12-12-2006 01:11 PM |
| How to get the Locations for the 4 vertices of a Square? | cx123 | MapPoint 2006/2009 Discussion | 0 | 10-26-2004 10:01 AM |
| Vertices and VB.Net | alon | MapPoint 2006/2009 Discussion | 2 | 08-26-2004 02:12 AM |
| How to determine the length of Shape.vertices in Delphi? | schuchhardp | MapPoint 2006/2009 Discussion | 0 | 12-13-2002 04:45 AM |
| Zip codes or cities vertices or shapes | Claude VERDIER | MapPoint 2006/2009 Discussion | 2 | 09-17-2002 05:21 AM |
Gatwick flight arrivals
On Holiday Hypermarket you can see where to find out information on Gatwick including flight arrivals and departures. Check it out now.
Turkey Weather
Check Turkey Weather before you travel. We provide information on Turkey including weather, flights and accommodation.
Holiday in Turkey
A Holiday in Turkey is great value when you book with dealchecker.co.uk. There is an abundance of things to see and do. Check out the well-preserved Greco-Roman ruins.
Holidays in Egypt
A holiday in Egypt will stimulate your mind, captivate your heart and spark your senses. Visit this exceptional country, book today!
Balearics
Before booking to the Balearics Islands make sure you check out our travel guide online. The Balearics are renowned for their vibrant nightlife but there are also some stunning Gothic cathedrals, Stone Age ruins and fishing villages.
All inclusive holidays
To plan all inclusive holidays, use Travel.co.uk to explore all the possibilities.
Holidays to Fuerteventura
Come on; jump on the plane to the Canary Islands. Get information on cheap holidays to Fuerteventura at On The Beach.