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


Get A SchematicElement In A Schematic Diagram Snippet (ArcObjects .NET 10.6 SDK)
ArcObjects Library Reference

Get A SchematicElement In A Schematic Diagram Snippet

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

[C#]
        /// <summary>
        /// Retrieve a SchematicElement in a SchematicDiagram from its name
        /// </summary>
        /// <param name="schemDiagram">The SchematicDiagram which contains the SchematicElement</param>
        /// <param name="schemType">The SchematicElement type</param>
        /// <param name="ElementName">The SchematicElement name</param>
        /// <returns>The retrieved SchematicElement</returns>
        public ESRI.ArcGIS.Schematic.ISchematicElement GetElementFromDiagramByName(ESRI.ArcGIS.Schematic.ISchematicDiagram schemDiagram, ESRI.ArcGIS.Schematic.esriSchematicElementType schemType, string ElementName)
        {
                ESRI.ArcGIS.Schematic.ISchematicElementContainer schElemCont=(ESRI.ArcGIS.Schematic.ISchematicElementContainer)schemDiagram;
                return schElemCont.get_SchematicElementByName(schemType, ElementName);
        }

[Visual Basic .NET]
        ''' <summary>
        ''' Retrieve a SchematicElement in a SchematicDiagram from its name
        ''' </summary>
        ''' <param name="schemDiagram">The SchematicDiagram which contains the SchematicElement</param>
        ''' <param name="schemType">The SchematicElement type</param>
        ''' <param name="ElementName">The SchematicElement name</param>
        ''' <returns>The retrieved SchematicElement</returns>
        Public Function GetElementFromDiagramByName(ByVal schemDiagram As ESRI.ArcGIS.Schematic.ISchematicDiagram, ByVal schemType As ESRI.ArcGIS.Schematic.esriSchematicElementType, ByVal ElementName As String) As ESRI.ArcGIS.Schematic.ISchematicElement

                Dim schElemCont As ESRI.ArcGIS.Schematic.ISchematicElementContainer=TryCast(schemDiagram, ESRI.ArcGIS.Schematic.ISchematicElementContainer)
                Return schElemCont.SchematicElementByName(schemType, ElementName)
        End Function

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