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


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

Get A Field Value For An In Memory Feature Snippet

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

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

                return schemFeature.get_Value(Index);
        }
[Visual Basic .NET]
        ''' <summary>
        ''' Retrieve the value of a particular field on an in-memory schematic feature
        ''' </summary>
        ''' <param name="schemFeature">The ISchematicInMemoryFeature for which you want to retrieve the field value</param>
        ''' <param name="FieldName">The name of the field for which you want to retrieve the value</param>
        ''' <returns>The retrieved object</returns>
        Public Function GetFieldValueFromSchematicFeatureByName(ByVal schemFeature As ESRI.ArcGIS.Schematic.ISchematicInMemoryFeature, ByVal FieldName As String) As Object
                Dim Index As Integer=schemFeature.Fields.FindFieldByAliasName(FieldName)

                Return schemFeature.Value(Index)
        End Function

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