View Single Post

  #3 (permalink)  
Old 03-29-2005
Anonymous Anonymous is offline
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
I'm not sure if I have explained the problem clearly based on your response.

Say you draw a closed triangle manually with the drawing tools. This means it has 3 vertices. This can easliy be done programatically as well. You create 3 location objects. Then use Shapes.AddPolyline, passing in the array of locations, which is size 4--the first location object is also repeated as the fourth location object. This tells mappoint to close the polygon (triangle). Easy enough. If you don't repeat the first location object in the fourth position, the triangle would not be closed.

Now, say you want programmatically determine in the code if this same triangle is closed:
1. Get the triangle from the Shapes Collection.
2. Get the array of location from the vertices property.
3. Here's the problem: The vertices array does not repeat the first location object if the polygon is closed. Therefore there is no way to distinguish this from a polygon that is open.
Reply With Quote