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


Get The Associations For A Schematic Element Snippet (ArcObjects .NET 10.6 SDK)
ArcObjects Library Reference

Get The Associations For A Schematic Element Snippet

Retrieve all the schematic element associations related to a schematic element

[C#]
        /// <summary>
        /// Retrieve all the schematic element associations related to a schematic element
        /// </summary>
        /// <param name="schemElt">The ISchematicElement for which you want to retrieve the association</param>
        /// <returns>The retrieved IEnumSchematicElementAssociation</returns>
        public ESRI.ArcGIS.Schematic.IEnumSchematicElementAssociation GetAssociationsFromElement(ESRI.ArcGIS.Schematic.ISchematicElement schemElt)
        {
                // cast the SchematicElement into ISchematicElementAssociationContainer
                ESRI.ArcGIS.Schematic.ISchematicElementAssociationContainer schAssoCont=(ESRI.ArcGIS.Schematic.ISchematicElementAssociationContainer)schemElt;

                return schAssoCont.SchematicElementAssociations;
        }
[Visual Basic .NET]
        ''' <summary>
        ''' Retrieve all the schematic element associations related to a schematic element
        ''' </summary>
        ''' <param name="schemElt">The ISchematicElement for which you want to retrieve the association</param>
        ''' <returns>The retrieved IEnumSchematicElementAssociation</returns>
        Public Function GetAssociationsFromElement(ByVal schemElt As ESRI.ArcGIS.Schematic.ISchematicElement) As ESRI.ArcGIS.Schematic.IEnumSchematicElementAssociation

                ' cast the SchematicElement into ISchematicElementAssociationContainer
                Dim schAssoCont As ESRI.ArcGIS.Schematic.ISchematicElementAssociationContainer=TryCast(schemElt, ESRI.ArcGIS.Schematic.ISchematicElementAssociationContainer)

                Return schAssoCont.SchematicElementAssociations
        End Function

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