Issue with Duplicate Line


https://www.nevron.com/Forum/Topic13179.aspx
Print Topic | Close Window

By Ashley Davy - 3 Years Ago
Earlier I posted a question on how to create a line for my custom library and I was supplied the following code which works but I do have the following issue.  Also in my library I have created a 2D shape which is a triangle.  On this shape and the line shape I have the DefaultShapeGlue set to nothing.  Here is the issue.  I first drag the line to the canvas.  I then drag the triangle to the canvas and place it on the line.  When I do this the line turns red and it creates 2 other lines beneath the original line.  How can I stop the line from turning red and stop the duplicate lines being created?
Thanks,
Ashley

Private Shared Sub InitAlternativeBranch1(ByVal shape As NShape)
shape.Init1DShape(EN1DShapeXForm.Vector)
shape.EndX = 200
shape.Height = 0
Dim geometry As NGeometry = shape.Geometry

If True Then
  Dim plotFigure As NMoveTo = geometry.RelMoveTo(0R, 0.5R)
  geometry.RelLineTo(1R, 0.5R)
  plotFigure.CloseFigure = False
  geometry.ClipWithTextBlock = ENGeometryClipWithShapeBlock.Clip
End If

Dim textBlock As NTextBlock = New NTextBlock()
textBlock.ResizeMode = ENTextBlockResizeMode.TextSize
textBlock.SetFx(NTextBlock.AngleProperty, "-ATAN2($Parent.EndY - $Parent.BeginY, $Parent.EndX - $Parent.BeginX)")
shape.TextBlock = textBlock
End Sub
By Nevron Support - 3 Years Ago
Hi,

The functionality you are talking about is called Connector Splitting.

You can disable it in any of the following ways:
  1. To disable it for the whole page and all shapes on it, set page.Interaction.Enable1DShapeSplitting to false
  2. To disable a 2D shape split connectors set its CanSplit property to false
  3. To disable a  1D shape (for example a connector or a line) to be split from a 2D shape, set its Splittable property to false