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


Change A Node-On-Link Schematic Feature Reference Link Snippet (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference

Change A Node-On-Link Schematic Feature Reference Link Snippet

Change the reference link of an in-memory node-on-link schematic feature. Since the Schematics core always checks reference link consistencies for connected node-on-links in-memory, the reference link for an in-memory node-on-link can only be changed on disconnected node-on-link.

[C#]
        /// <summary>
        /// Change the reference link of an in-memory node-on-link schematic feature
        /// </summary>
        /// <param name="schemNodeOnLink">The ISchematicInMemoryFeatureNodeOnLink which reference link must be changed</param>
        /// <param name="newReferenceLink">The new ISchematicInMemoryFeatureLink reference link</param>
        /// <remarks>Since the Schematics core always checks reference link consistencies for connected node-on-links in-memory, the reference link for an in-memory node-on-link can only be changed on disconnected node-on-link.</remarks>
        public void ChangeReferenceLinkOfNodeOnLink(ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureNodeOnLink schemNodeOnLink, ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLink newReferenceLink)
        {
                // cast SchematicInMemoryFeatureNodeOnLink into ISchematicInMemoryFeatureNode
                ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureNode schNode=(ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureNode)schemNodeOnLink;
            
                // verify that the node-on-link is disconnected
                ESRI.ArcGIS.Schematic.IEnumSchematicInMemoryFeatureLink schLinks=schNode.GetIncidentLinks(ESRI.ArcGIS.Schematic.esriSchematicEndPointType.esriSchematicOriginOrExtremityNode);
                if (schLinks.Count == 0)
                {
                        schemNodeOnLink.ReferenceLink=newReferenceLink;
                }
        }
[Visual Basic .NET]
        ''' <summary>
        ''' Change the reference link of an in-memory node-on-link schematic feature 
        ''' </summary>
        ''' <param name="schemNodeOnLink">The ISchematicInMemoryFeatureNodeOnLink which reference link must be changed</param>
        ''' <param name="newReferenceLink">The new ISchematicInMemoryFeatureLink reference link</param>
        ''' <remarks>Since the Schematics core always checks reference link consistencies for connected node-on-links in-memory, the reference link for an in-memory node-on-link can only be changed on disconnected node-on-link.</remarks>
        Public Sub ChangeReferenceLinkOfNodeOnLink(ByVal schemNodeOnLink As ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureNodeOnLink, ByVal newReferenceLink As ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLink)

                ' cast SchematicInMemoryFeatureNodeOnLink into ISchematicInMemoryFeatureNode
                Dim schNode As ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureNode=TryCast(schemNodeOnLink, ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureNode)

                ' verify that the node-on-link is disconnected
                Dim schLinks As ESRI.ArcGIS.Schematic.IEnumSchematicInMemoryFeatureLink=schNode.GetIncidentLinks(ESRI.ArcGIS.Schematic.esriSchematicEndPointType.esriSchematicOriginOrExtremityNode)
                If (schLinks.Count=0) Then
                        schemNodeOnLink.ReferenceLink=newReferenceLink
                End If
        End Sub

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