ArcObjects Library Reference (Geometry)  

Path CoClass

A sequence of connected segments.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Extended Error Information

Use the ISupportErrorInfo method InterfaceSupportsErrorInfo to determine if the object supports extended error information. If the object supports extended error info, VC++ developers should use the OLE/COM IErrorInfo interface to access the ErrorInfo object. Visual Basic developers should use the global error object Err to retrieve this extended error information.

Interfaces

Interfaces Description
IClone (esriSystem) Provides access to members that control cloning of objects.
IConstructPath Provides access to members that construct a path using other geometries and measures.
ICurve Provides access to properties and methods of all 1 dimensional curves (polylines, segments, boundaries of polygons, etc.).
IGeometry Provides access to members that describe properties and behavior of all geometric objects.
IPath Provides access to members that identify a path and define its behavior.
IPointCollection Provides access to members that manipulate the points of a Multipoint, Path, Ring, Polyline, Polygon, TriangleFan, TriangleStrip, or MultiPatch.
IPointCollection3 Provides access to members that manipulate the points of a Multipoint.
IPointCollection4 Provides access to members that manipulate the points of a Multipoint, Path, Ring, Polyline, Polygon, TriangleFan, TriangleStrip, or MultiPatch.
ISegmentCollection Provides access to members that manipulate the segments of a path, ring, polyline, or polygon.
ISupportErrorInfo Indicates whether a specific interface can return Automation error objects.
ITransform2D Provides access to methods for transforming geometries using either specific parameters or arbitrary transformation objects (affine transformations, geographic transformations, etc.).
ITransform3D Provides access to methods for transforming 3D geometries using either specific parameters or arbitrary transformation objects.
IXMLSerialize (esriSystem) Provides access to members that XML serialize and deserialize an object to/from XML.
[C#]

 

 

        private static object _missing = Type.Missing;

 

        public static IGeometry GetPathGeometry()

        {

               const double PathVertexCount = 3;

               IPointCollection pointCollection = new PathClass();

 

               for (int i = 0; i < PathVertexCount; i++)

               {

                      pointCollection.AddPoint(GetPoint(), ref _missing, ref _missing);

               }

 

            return pointCollection as IGeometry;

        }

        private static IPoint GetPoint()

        {

            const double Min = -10;

            const double Max = 10;

 

            Random random = new Random();

 

            double x = Min + (Max - Min) * random.NextDouble();

            double y = Min + (Max - Min) * random.NextDouble();

            double z = Min + (Max - Min) * random.NextDouble();

 

            return ConstructPoint3D(x, y, z);

        }

 

        private static IPoint ConstructPoint3D(double x, double y, double z)

        {

            IPoint point = ConstructPoint2D(x, y);

            point.Z = z;

           
return point;

        }


        private static IPoint ConstructPoint2D(double x, double y)

        {

            IPoint point = new PointClass();

            point.PutCoords(x, y);
 

            return point;

        }