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


Loop On The Schematic In-Memory Feature Classes Related To A Schematic In-Memory Diagram Snippet (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference

Loop On The Schematic In-Memory Feature Classes Related To A Schematic In-Memory Diagram Snippet

Looping on all the schematic in-memory feature classes related to a given schematic in-memory diagram

[C#]
        /// <summary>
        /// Looping on all the schematic in-memory feature classes related to a given schematic in-memory diagram
        /// </summary>
        /// <param name="schemInMemoryDiagram">The input ISchematicInMemoryDiagram</param>
        public void SchematicInMemoryFeatureClassFromSchematicInMemoryDiagram(ESRI.ArcGIS.Schematic.ISchematicInMemoryDiagram schemInMemoryDiagram)
        {
                // cast SchematicInMemoryDiagram to ISchematicInMemoryFeatureClassContainer
                ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureClassContainer schInMemoryFeatureClassCont=(ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureClassContainer)schemInMemoryDiagram;

                // get all the SchematicInMemoryFeatureClass
                ESRI.ArcGIS.Schematic.IEnumSchematicInMemoryFeatureClass enumInMemoryFeatureClass=schInMemoryFeatureClassCont.SchematicInMemoryFeatureClasses;
                enumInMemoryFeatureClass.Reset();

                // get the first SchematicInMemoryFeatureClass
                ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureClass schInMemoryFeatureClass=enumInMemoryFeatureClass.Next();
                bool isOk=false;
                while (schInMemoryFeatureClass != null)
                {
                        // TODO: add your code here, set isOk to true to exit the loop

                        if (isOk) break;

                        // get the next SchematicInMemoryFeatureClass
                        schInMemoryFeatureClass=enumInMemoryFeatureClass.Next();
                }
        }
[Visual Basic .NET]
        ''' <summary>
        ''' Looping on all the schematic in-memory feature classes related to a given schematic in-memory diagram
        ''' </summary>
        ''' <param name="schemInMemoryDiagram">The input ISchematicInMemoryDiagram</param>
        Public Sub SchematicInMemoryFeatureClassFromSchematicInMemoryDiagram(ByVal schemInMemoryDiagram As ESRI.ArcGIS.Schematic.ISchematicInMemoryDiagram)
                ' cast SchematicInMemoryDiagram to ISchematicInMemoryFeatureClassContainer
                Dim schInMemoryFeatureClassCont As ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureClassContainer=TryCast(schemInMemoryDiagram, ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureClassContainer)

                ' get all SchematicInMemoryFeatureClass
                Dim enumInMemoryFeatureClass As ESRI.ArcGIS.Schematic.IEnumSchematicInMemoryFeatureClass=schInMemoryFeatureClassCont.SchematicInMemoryFeatureClasses
                enumInMemoryFeatureClass.Reset()

                ' get the first SchematicInMemoryFeatureClass
                Dim schInMemoryFeatureClass As ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureClass=enumInMemoryFeatureClass.Next()
                Dim isOk As Boolean=False
                While (schInMemoryFeatureClass IsNot Nothing)

                        ' TODO: add your code here, set isOk to true to exit the loop

                        If (isOk) Then Exit While

                        ' get the next SchematicInMemoryFeatureClass
                        schInMemoryFeatureClass=enumInMemoryFeatureClass.Next()
                End While
        End Sub

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