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


Update A Vertex On A SchematicInMemoryFeatureLink Snippet (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference

Update A Vertex On A SchematicInMemoryFeatureLink Snippet

Update a vertex on an in-memory schematic feature link

[C#]
        /// <summary>
        /// Update a vertex on an in-memory schematic feature link
        /// </summary>
        /// <param name="schemLink">The ISchematicInMemoryFeatureLink where the vertex is updated</param>
        /// <param name="newXPos">The new X Position for the updated vertex</param>
        /// <param name="newYPos">The new Y Position for the updated vertex</param>
        /// <param name="VertexPosition">The index of the updated vertex</param>
        public void UpdateVertexCollectionToLink(ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLink schemLink, double newXPos, double newYPos, int VertexPosition)
        {
                // cast SchematicInMemoryFeatureLink into ISchematicInMemoryFeatureLinkGeometry
                ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLinkGeometry myGeo=(ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLinkGeometry)schemLink;
                if (myGeo != null)
                {
                        ESRI.ArcGIS.Geometry.IPoint newPoint=new ESRI.ArcGIS.Geometry.PointClass();
                        newPoint.PutCoords(newXPos, newYPos);
                        myGeo.UpdateVertex(VertexPosition, newPoint);
                }
        }
[Visual Basic .NET]
        ''' <summary>
        ''' Update a vertex on an in-memory schematic feature link
        ''' </summary>
        ''' <param name="schemLink">The ISchematicInMemoryFeatureLink where the vertex is updated</param>
        ''' <param name="NewXPos">The new X Position for the updated vertex</param>
        ''' <param name="NewYPos">The new Y Position for the updated vertex</param>
        ''' <param name="VertexPosition">The index of the updated vertex</param>
        Public Sub UpdateVertexCollectionToLink(ByVal schemLink As ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLink, ByVal NewXPos As Double, ByVal NewYPos As Double, ByVal VertexPosition As Integer)

                ' cast SchematicInMemoryFeatureLink into ISchematicInMemoryFeatureLinkGeometry
                Dim myGeo As ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLinkGeometry=TryCast(schemLink, ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLinkGeometry)
                If myGeo IsNot Nothing Then
                        Dim newPoint As ESRI.ArcGIS.Geometry.IPoint=New ESRI.ArcGIS.Geometry.PointClass()
                        newPoint.PutCoords(NewXPos, NewYPos)
                        myGeo.UpdateVertex(VertexPosition, newPoint)
                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