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


Get The SchematicInMemoryFeatureClass Related To A Schematic Element Class From An In-Memory Schematic Diagram Snippet (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference

Get The SchematicInMemoryFeatureClass Related To A Schematic Element Class From An In-Memory Schematic Diagram Snippet

Retrieve the SchematicInMemoryFeatureClass related to a given schematic element class from an in-memory schematic diagram

[C#]
        /// <summary>
        /// Retrieve the SchematicInMemoryFeatureClass related to a given schematic element class from an in-memory schematic diagram
        /// </summary>
        /// <param name="schemInMemoryDiagram">The input ISchematicInMemoryDiagram</param>
        /// <param name="schemElementClass">The related ISchematicElementClass</param>
        /// <returns>The retrieved ISchematicInMemoryFeatureClass</returns>
        public ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureClass GetSchematicInMemoryFeatureClassFromSchematicInMemoryDiagramByElementClass(ESRI.ArcGIS.Schematic.ISchematicInMemoryDiagram schemInMemoryDiagram, ESRI.ArcGIS.Schematic.ISchematicElementClass schemElementClass)
        {
                // cast SchematicInMemoryDiagram into ISchematicInMemoryFeatureClassContainer
                ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureClassContainer schInMemoryFeatureClassCont=(ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureClassContainer)schemInMemoryDiagram;

                // return the ISchematicInMemoryFeatureClass related to the desired ISchematicElementClass
                return schInMemoryFeatureClassCont.GetSchematicInMemoryFeatureClass(schemElementClass);
        }
[Visual Basic .NET]
        ''' <summary>
        ''' Retrieve the SchematicInMemoryFeatureClass related to a given schematic element class from an in-memory schematic diagram
        ''' </summary>
        ''' <param name="schemInMemoryDiagram">The input ISchematicInMemoryDiagram</param>
        ''' <param name="schemElementClass">The related ISchematicElementClass</param>
        ''' <returns>The retrieved ISchematicInMemoryFeatureClass</returns>
        Public Function GetSchematicInMemoryFeatureClassFromSchematicInMemoryDiagramByElementClass(ByVal schemInMemoryDiagram As ESRI.ArcGIS.Schematic.ISchematicInMemoryDiagram, ByVal schemElementClass As ESRI.ArcGIS.Schematic.ISchematicElementClass) As ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureClass

                ' cast SchematicInMemoryDiagram into ISchematicInMemoryFeatureClassContainer
                Dim schInMemoryFeatureClassCont As ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureClassContainer=TryCast(schemInMemoryDiagram, ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureClassContainer)

                ' return the ISchematicInMemoryFeatureClass related to the desired ISchematicElementClass
                Return schInMemoryFeatureClassCont.GetSchematicInMemoryFeatureClass(schemElementClass)
        End Function

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