ESRI.ArcGIS.E2API Feedback via the User Forum
Polygon Class
See Also  Members   Example 
ESRI.ArcGIS.E2API Namespace : Polygon Class


A geometry representing an ordered sequence of points which describe a closed figure.

Object Model




Syntax

Visual Basic (Declaration) 
<ComVisibleAttribute(False)>
Public NotInheritable Class Polygon 
   Inherits Geometry
Visual Basic (Usage)Copy Code
Dim instance As Polygon
C# 
[ComVisibleAttribute(false)]
public sealed class Polygon : Geometry 

Example

This example demonstrates how to create a Polygon bounding Central Park, New York, and use the Polygon as a Geomtery for a PlaceResult.
C#Copy Code
//Create Task Context. 
TaskContext newTaskContext = new TaskContext(); 
newTaskContext.TaskName = "MyCustomTask.CustomTask"; 
newTaskContext.TaskUIName = _taskUI.Name; 
 
ESRI.ArcGIS.E2API.PlaceResult MyPlaceResult = new PlaceResult(); 
MyPlaceResult.Title = "My Place Result"; 
 
ESRI.ArcGIS.E2API.Polygon MyPolygon = new Polygon(); 
 
//Add four corners of Central Park, New York 
MyPolygon.Points.AddPoint(new Point(-73.981, 40.767, 0)); 
MyPolygon.Points.AddPoint(new Point(-73.958, 40.799, 0)); 
MyPolygon.Points.AddPoint(new Point(-73.949, 40.796, 0)); 
MyPolygon.Points.AddPoint(new Point(-73.972, 40.764, 0)); 
 
//Get PointCollection of Polygon 
ESRI.ArcGIS.E2API.PointCollection MyPointCollection = MyPolygon.Points; 
//Add first point as final point to collection to close polygon 
MyPolygon.Points.AddPoint(MyPointCollection.GetPoint(0)); 
 
MyPlaceResult.Geometry = MyPolygon; 
MyPlaceResult.SymbolName = "Red Fill"; 
 
newTaskContext.UpdateResult(MyPlaceResult);
Visual BasicCopy Code
'Create Task Context.
Dim NewTaskContext As TaskContext = New TaskContext()
NewTaskContext.TaskName = "MyCustomTask.CustomTask"
NewTaskContext.TaskUIName = _taskUI.Name

Dim MyPlaceResult As ESRI.ArcGIS.E2API.PlaceResult = New PlaceResult()
MyPlaceResult.Title = "My Place Result"

Dim MyPolygon As ESRI.ArcGIS.E2API.Polygon = New Polygon()

'Add four corners of Central Park, New York
MyPolygon.Points.AddPoint(New Point(-73.981,40.767,0))
MyPolygon.Points.AddPoint(New Point(-73.958,40.799,0))
MyPolygon.Points.AddPoint(New Point(-73.949,40.796,0))
MyPolygon.Points.AddPoint(New Point(-73.972,40.764,0))

'Get PointCollection of Polygon
Dim MyPointCollection As ESRI.ArcGIS.E2API.PointCollection = MyPolygon.Points
'Add first point as final point to collection to close polygon
MyPolygon.Points.AddPoint(MyPointCollection.GetPoint(0))

MyPlaceResult.GeomeTry = MyPolygon
MyPlaceResult.SymbolName = "Red Fill"

NewTaskContext.UpdateResult(MyPlaceResult)

Inheritance Hierarchy

System.Object
   ESRI.ArcGIS.E2API.Geometry
      ESRI.ArcGIS.E2API.Polygon

Platforms

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Version Information

This class was added to the E2API at version 1.0.0.348.

See Also