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


Change An In-Memory Schematic Feature Node Coordinates Snippet (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference

Change An In-Memory Schematic Feature Node Coordinates Snippet

Change the coordinates of an in-memory schematic feature node

[C#]
        /// <summary>
        /// Change the coordinates of an in-memory schematic feature node
        /// </summary>
        /// <param name="schemNode">The ISchematicInMemoryFeatureNode which coordinates must be changed</param>
        /// <param name="newXPos">The new X Position for the in-memory schematic feature node</param>
        /// <param name="newYPos">The new Y Position for the in-memory schematic feature node</param>
        public void ChangeNodePosition(ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureNode schemNode, double newXPos, double newYPos)
        {
                // cast SchematicInMemoryFeatureNodeOnLink into ISchematicInMemoryFeatureNodeGeometry
                ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureNodeGeometry myGeo=(ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureNodeGeometry)schemNode;
                if (myGeo != null)
                {
                        myGeo.PutCoords(newXPos, newYPos);
                }
        }
[Visual Basic .NET]
        ''' <summary>
        ''' Change the coordinates of an in-memory schematic feature node
        ''' </summary>
        ''' <param name="schemNode">The ISchematicInMemoryFeatureNode which coordinates must be changed</param>
        ''' <param name="NewXPos">The new X Position for the in-memory schematic feature node</param>
        ''' <param name="NewYPos">The new Y Position for the in-memory schematic feature node</param>
        ''' <remarks></remarks>
        Public Sub ChangeNodePosition(ByVal schemNode As ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureNode, ByVal NewXPos As Double, ByVal NewYPos As Double)

                ' cast SchematicInMemoryFeatureNodeOnLink into ISchematicInMemoryFeatureNodeGeometry
                Dim myGeo As ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureNodeGeometry=TryCast(schemNode, ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureNodeGeometry)
                If myGeo IsNot Nothing Then
                        myGeo.PutCoords(NewXPos, NewYPos)
                End If
        End Sub

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