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


Get A Schematic Diagram In A Schematic Folder From The SchematicDiagram Name Snippet (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference

Get A Schematic Diagram In A Schematic Folder From The SchematicDiagram Name Snippet

Retrieve a schematic diagram in a given schematic dataset from its name

[C#]
        /// <summary>
        /// Retrieve a SchematicDiagram in a schematic folder from its name
        /// </summary>
        /// <param name="schemFolder">The ISchematicFolder where the schematic diagram is stored</param>
        /// <param name="schemDiagClass">The ISchematicDiagramClass the diagram is based on</param>
        /// <param name="DiagramName">The schematic diagram name</param>
        ///  <returns>The retrieved ISchematicDiagram</returns>
        public ESRI.ArcGIS.Schematic.ISchematicDiagram GetSchematicDiagramFromSchematicFolderByName(ESRI.ArcGIS.Schematic.ISchematicFolder schemFolder, ESRI.ArcGIS.Schematic.ISchematicDiagramClass schemDiagClass, string DiagramName)
        {
                // cast SchematicFolder into ISchematicDiagramContainer
                ESRI.ArcGIS.Schematic.ISchematicDiagramContainer schDiagramCont=(ESRI.ArcGIS.Schematic.ISchematicDiagramContainer)schemFolder;

                return schDiagramCont.get_SchematicDiagramByName(schemDiagClass, DiagramName);
        }
[Visual Basic .NET]
        ''' <summary>
        ''' Retrieve a SchematicDiagram in a schematic folder from its name
        ''' </summary>
        ''' <param name="schemFolder">The ISchematicFolder where the schematic diagram is stored</param>
        ''' <param name="schemDiagClass">The ISchematicDiagramClass the diagram is based on</param>
        ''' <param name="DiagramName">The schematic diagram name</param>
        ''' <returns>The retrieved ISchematicDiagram</returns>
        Public Function GetSchematicDiagramFromSchematicFolderByName(ByVal schemFolder As ESRI.ArcGIS.Schematic.ISchematicFolder, ByVal schemDiagClass As ESRI.ArcGIS.Schematic.ISchematicDiagramClass, ByVal DiagramName As String) As ESRI.ArcGIS.Schematic.ISchematicDiagram
                ' cast SchematicFolder into ISchematicDiagramContainer
                Dim schDiagramCont As ESRI.ArcGIS.Schematic.ISchematicDiagramContainer=TryCast(schemFolder, ESRI.ArcGIS.Schematic.ISchematicDiagramContainer)

                Return schDiagramCont.SchematicDiagramByName(schemDiagClass, DiagramName)
        End Function

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