I am writing some VBA code to extract vertices from a polygon.
I would like to ask, how to select the vertices from a polygon ?
Regards Gary
|
I am writing some VBA code to extract vertices from a polygon. I would like to ask, how to select the vertices from a polygon ? Regards Gary |
||||
|
|
Once you have the Polygon, QI to IPointCollection. You can then iterate over all the points in this PointCollection which are the vertices that you need. Here is some code which shows how to get the selected features & then get the geometry: I am writing this from memory, so it might not be exactly correct, but should give you an idea
|
||||
|
|
|
If you have ArcInfo, you can use Feature Vertices to Points (Data Management) to extract the points. However, these tools are available for Arc Toolbox (GUI), Arc console ( |
|||
|
|
|
Hi I have used code similar to that posted by Devdatta above, in my case to create SDOGeometry from edits to a shapefile. If you have multipart polygons or polygons with internal holes you have to get a bit more involved in the geometry. Start with the polygon and loop each external ring and check if each has any internal rings. It works but you need to be thourough unless you can guarantee your geometry will always be simple single parts with no holes. On that point, does anyone know how to interpret the feature created by editing a polygon using the Arc Tool? This seems to only store a start and end point and my SDOGeometry feature obviously does not reflect the Arc. One the edit session is stopped the shapefile feature updates to relpace the Arc with a series of points approximating the Arc but I want to access it without stopping editing. |
|||
|