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


Loop On The Schematic Folders In A Schematic Dataset Snippet (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference

Loop On The Schematic Folders In A Schematic Dataset Snippet

Looping on all the schematic folders stored in a given schematic dataset

[C#]
        /// <summary>
        /// Looping on all the schematic folders in a given SchematicDataset
        /// </summary>
        /// <param name="schemDataset">The SchematicDataset which contains the schematic folders</param>
        public void SchematicFolderFromSchematicDataset(ESRI.ArcGIS.Schematic.ISchematicDataset schemDataset)
        {
                // cast SchematicDataset to ISchematicFolderContainer
                ESRI.ArcGIS.Schematic.ISchematicFolderContainer schFolderCont=(ESRI.ArcGIS.Schematic.ISchematicFolderContainer)schemDataset;

                // retrieve all the SchematicFolder in the schematic dataset container
                ESRI.ArcGIS.Schematic.IEnumSchematicFolder enumFolder=schFolderCont.SchematicFolders;
                enumFolder.Reset();

                // Get the first SchematicFolder
                ESRI.ArcGIS.Schematic.ISchematicFolder schFolder=enumFolder.Next();
                bool isOk=false;
                while (schFolder != null)
                {
                        // TODO: add your code here, set isOk to true to exit the loop

                        if (isOk) break;

                        // Get the next SchematicFolder
                        schFolder=enumFolder.Next();
                }
        }
[Visual Basic .NET]
        ''' <summary>
        ''' Looping on all the schematic folders in a given SchematicDataset
        ''' </summary>
        ''' <param name="schemDataset">The SchematicDataset which contains the schematic folders</param>
        Public Sub SchematicFolderFromSchematicDataset(ByVal schemDataset As ESRI.ArcGIS.Schematic.ISchematicDataset)

                ' cast SchematicDataset to ISchematicFolderContainer
                Dim schFolderCont As ESRI.ArcGIS.Schematic.ISchematicFolderContainer=TryCast(schemDataset, ESRI.ArcGIS.Schematic.ISchematicFolderContainer)

                ' retrieve all the SchematicFolder in the schematic dataset container
                Dim enumFolder As ESRI.ArcGIS.Schematic.IEnumSchematicFolder=schFolderCont.SchematicFolders
                enumFolder.Reset()

                ' get the first SchematicFolder
                Dim schFolder As ESRI.ArcGIS.Schematic.ISchematicFolder=enumFolder.Next()
                Dim isOk As Boolean=False
                While (schFolder IsNot Nothing)
                        ' TODO: add your code here, set isOk to true to exit the loop

                        If (isOk) Then Exit While

                        ' get the next SchematicFolder
                        schFolder=enumFolder.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