This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ESRI.ArcGIS.Snippets > Snippets > Add A Vertex On A SchematicInMemoryFeatureLink Snippet (ArcObjects .NET 10.4 SDK) |
Add a vertex on a SchematicInMemoryFeatureLink at a particular (X, Y) location. The vertex is added on the last link segment.
/// <summary> /// Add a vertex on a SchematicInMemoryFeatureLink at a particular (X, Y) location /// </summary> /// <param name="schemLink">The ISchematicInMemoryFeatureLink where the vertex is added</param> /// <param name="XPos">The X position for the added vertex</param> /// <param name="YPos">The Y position for the added vertex</param> public void AddOneVertexToLink(ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLink schemLink, double XPos, double YPos) { // cast SchematicInMemoryFeatureLink into ISchematicInMemoryFeatureLinkGeometry ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLinkGeometry myGeo=(ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLinkGeometry)schemLink; if (myGeo != null) { ESRI.ArcGIS.Geometry.IPoint myPoint=new ESRI.ArcGIS.Geometry.Point(); myPoint.PutCoords(XPos, YPos); myGeo.AddVertex(myPoint); } }
''' <summary> ''' Add a vertex on a SchematicInMemoryFeatureLink at a particular (X, Y) location ''' </summary> ''' <param name="schemLink">The ISchematicInMemoryFeatureLink where the vertex is added</param> ''' <param name="XPos">The X position for the added vertex</param> ''' <param name="YPos">The Y position for the added vertex</param> Public Sub AddOneVertexToLink(ByVal schemLink As ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLink, ByVal XPos As Double, ByVal YPos As Double) ' cast SchematicInMemoryFeatureLink into ISchematicInMemoryFeatureLinkGeometry Dim myGeo As ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLinkGeometry=TryCast(schemLink, ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLinkGeometry) If myGeo IsNot Nothing Then Dim myPoint As ESRI.ArcGIS.Geometry.IPoint=New ESRI.ArcGIS.Geometry.Point() myPoint.PutCoords(XPos, YPos) myGeo.AddVertex(myPoint) End If End Sub