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


Change A Field Value For An In Memory Feature Snippet (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference

Change A Field Value For An In Memory Feature Snippet

Change the value of a particular field on an in-memory schematic feature

[C#]
        /// <summary>
        /// Change the value of a particular field on an in-memory schematic feature
        /// </summary>
        /// <param name="schemFeature">The ISchematicInMemoryFeature for which you want to change the field value</param>
        /// <param name="FieldName">The name of the field for which you want to change the value</param>
        /// <param name="newValue">the changed object</param>
        public void ChangeFieldValueFromSchematicFeatureByName(ESRI.ArcGIS.Schematic.ISchematicInMemoryFeature schemFeature, string FieldName, object newValue)
        {
                int Index=schemFeature.Fields.FindFieldByAliasName(FieldName);

                schemFeature.set_Value(Index, newValue);
        }
[Visual Basic .NET]
        ''' <summary>
        ''' Change the value of a particular field on an in-memory schematic feature
        ''' </summary>
        ''' <param name="schemFeature">The ISchematicInMemoryFeature for which you want to change the field value</param>
        ''' <param name="FieldName">The name of the field for which you want to change the value</param>
        ''' <param name="NewValue">The changed object</param>
        Public Sub ChangeFieldValueFromSchematicFeatureByName(ByVal schemFeature As ESRI.ArcGIS.Schematic.ISchematicInMemoryFeature, ByVal FieldName As String, ByVal NewValue As Object)

                Dim Index As Integer=schemFeature.Fields.FindFieldByAliasName(FieldName)

                schemFeature.Value(Index)=NewValue
        End Sub

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