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


Get A SchematicInMemoryDiagram Based On A Schematic Diagram Class Snippet (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference

Get A SchematicInMemoryDiagram Based On A Schematic Diagram Class Snippet

Retrieve a particular SchematicInMemoryDiagram based on a given SchematicDiagramClass from its name

[C#]
        /// <summary>
        /// Retrieve a particular SchematicInMemoryDiagram based on a given SchematicDiagramClass from its name
        /// </summary>
        /// <param name="schemDiagramClass">The SchematicDiagramClass on which the diagram is based</param>
        /// <param name="InMemoryDiagramName">The name of the schematic in-memory diagram to retrieve</param>
        /// <returns>The retrieved SchematicInMemoryDiagram</returns>
        public ESRI.ArcGIS.Schematic.ISchematicInMemoryDiagram GetSchematicInMemoryDiagramFromDiagramClassByName(ESRI.ArcGIS.Schematic.ISchematicDiagramClass schemDiagramClass, string InMemoryDiagramName)
        {
                // cast SchematicDiagramClass to ISchematicInMemoryDiagramContainer
                ESRI.ArcGIS.Schematic.ISchematicInMemoryDiagramContainer schInMemoryDiagramCont=(ESRI.ArcGIS.Schematic.ISchematicInMemoryDiagramContainer)schemDiagramClass;

                return schInMemoryDiagramCont.GetSchematicInMemoryDiagram(InMemoryDiagramName);
        }
[Visual Basic .NET]
        ''' <summary>
        ''' Retrieve a particular SchematicInMemoryDiagram based on a given SchematicDiagramClass from its name
        ''' </summary>
        ''' <param name="schemDiagramClass">The SchematicDiagramClass on which the diagram is based</param>
        ''' <param name="InMemoryDiagramName">The name of the schematic in-memory diagram to retrieve</param>
        ''' <returns>The retrieved SchematicInMemoryDiagram</returns>
        Public Function GetSchematicInMemoryDiagramFromDiagramClassByName(ByVal schemDiagramClass As ESRI.ArcGIS.Schematic.ISchematicDiagramClass, ByVal InMemoryDiagramName As String) As ESRI.ArcGIS.Schematic.ISchematicInMemoryDiagram

                ' cast SchematicDiagramClass into ISchematicInMemoryDiagramContainer
                Dim schInMemoryDiagramCont As ESRI.ArcGIS.Schematic.ISchematicInMemoryDiagramContainer=TryCast(schemDiagramClass, ESRI.ArcGIS.Schematic.ISchematicInMemoryDiagramContainer)

                Return schInMemoryDiagramCont.GetSchematicInMemoryDiagram(InMemoryDiagramName)
        End Function

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