View Single Post
Old 28-03-2017, 03:48
shark shark is offline
Senior Member
Join Date: Aug 2010
Location: Russia, Belgorod
Posts: 146
Default Found some free time

Private Sub JoinNodes()
Dim s As Shape, sr As ShapeRange
Dim x1#, y1#, x2#, y2#
    Set sr = ActiveSelectionRange
    If sr.Count <> 2 Then MsgBox "Select 2 shapes!": Exit Sub
    If sr(1).Curve.Closed Or sr(2).Curve.Closed Then MsgBox "Shapes must be unclosed!": Exit Sub
    sr(1).Curve.Nodes(1).GetPosition x1, y1
    sr(2).Curve.Nodes(1).GetPosition x2, y2
    Set s = sr(1).Weld(sr(2))
    s.Curve.FindNodeAtPoint(x1, y1).ConnectWith s.Curve.FindNodeAtPoint(x2, y2)
    s.Curve.Closed = True 'Connect the remaining nodes
End Sub
Attached Images

Last edited by shark; 28-03-2017 at 03:51. Reason: resize picture
Reply With Quote