This document is archived and information here might be outdated.  Recommended version.


Add A Vertex On A SchematicInMemoryFeatureLink Snippet (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference

Add A Vertex On A SchematicInMemoryFeatureLink Snippet

Add a vertex on a SchematicInMemoryFeatureLink at a particular (X, Y) location. The vertex is added on the last link segment.

[C#]
        /// <summary>
        /// Add a vertex on a SchematicInMemoryFeatureLink at a particular (X, Y) location
        /// </summary>
        /// <param name="schemLink">The ISchematicInMemoryFeatureLink where the vertex is added</param>
        /// <param name="XPos">The X position for the added vertex</param>
        /// <param name="YPos">The Y position for the added vertex</param>
        public void AddOneVertexToLink(ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLink schemLink, double XPos, double YPos)
        {
                // cast SchematicInMemoryFeatureLink into ISchematicInMemoryFeatureLinkGeometry
                ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLinkGeometry myGeo=(ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLinkGeometry)schemLink;
                if (myGeo != null)
                {
                        ESRI.ArcGIS.Geometry.IPoint myPoint=new ESRI.ArcGIS.Geometry.Point();
                        myPoint.PutCoords(XPos, YPos);

                        myGeo.AddVertex(myPoint);
                }
        }
[Visual Basic .NET]
''' <summary>
''' Add a vertex on a SchematicInMemoryFeatureLink at a particular (X, Y) location
''' </summary>
''' <param name="schemLink">The ISchematicInMemoryFeatureLink where the vertex is added</param>
''' <param name="XPos">The X position for the added vertex</param>
''' <param name="YPos">The Y position for the added vertex</param>
Public Sub AddOneVertexToLink(ByVal schemLink As ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLink, ByVal XPos As Double, ByVal YPos As Double)

        ' cast SchematicInMemoryFeatureLink into ISchematicInMemoryFeatureLinkGeometry
        Dim myGeo As ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLinkGeometry=TryCast(schemLink, ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLinkGeometry)
        If myGeo IsNot Nothing Then
                Dim myPoint As ESRI.ArcGIS.Geometry.IPoint=New ESRI.ArcGIS.Geometry.Point()
                myPoint.PutCoords(XPos, YPos)

                myGeo.AddVertex(myPoint)
        End If
End Sub

Additional Requirements
  • The code in this document requires the following References added to the Visual Studio project:
  • ESRI.ArcGIS.Geometry
  • ESRI.ArcGIS.Schematic