View Single Post
  #2  
Old 26-03-2017, 13:58
nic nic is offline
Member
 
Join Date: May 2009
Posts: 90
Default works - not pretty

Managed to blunder way through - mainly using answers from this forum

Using the xy coordinates of nodes at the ends of the lines; added new lines, added all to a shaperange and joined overlapping nodes.

Code:
sr.Add sShape
sr.Add sShape2
    
    Set n1 = sShape.Curve.Nodes.Last
    Set n2 = sShape.Curve.Nodes.First
    Set n3 = sShape2.Curve.Nodes.First
    Set n4 = sShape2.Curve.Nodes.Last
    
    a = n1.PositionX
    b = n1.PositionY
    c = n2.PositionX
    d = n2.PositionY
    e = n3.PositionX
    f = n3.PositionY
    g = n4.PositionX
    h = n4.PositionY
    
    
    Set crv = CreateCurve(ActiveDocument)
    Set sp = crv.CreateSubPath(a, b)
    sp.AppendCurveSegment e, f
    Set sShape3 = ActiveLayer.CreateCurve(crv)
    sr.Add sShape3
    
    
    Set crv = CreateCurve(ActiveDocument)
    Set sp = crv.CreateSubPath(c, d)
    sp.AppendCurveSegment g, h
    Set sShape4 = ActiveLayer.CreateCurve(crv)
    sr.Add sShape4
    
    Set s = sr.Combine
    
    s.CustomCommand "ConvertTo", "JoinCurves", 0.01
     sr.RemoveAll
Reply With Quote