Hi, i try to write code to draw pipe between two others. Now i get two closest connectors and pipes vectors. Here i stuck… I tried to use ComputeClosestPoint to get “midpoints” between connsectors. It doesn’t work. I get error :TypeError: expected StrongBox[IList[ClosestPointsPairBetweenTwoCurves]], got ClosestPointsPairBetweenTwoCurves

This is what i want to draw:

here my code(sorry for mess but i’m still fighting):

```
# create pipe between and add to closest_connectors list
## get middle point
p1 = closest_connectors.items()[0]
p2 = closest_connectors.items()[1]
print(p1[0].Owner.Location.Curve)
vector_p1 = p1[0].Owner.Location.Curve
vector_p2 = p2[0].Owner.Location.Curve
vector_p1_num = vector_p1.GetEndPoint(1) - vector_p1.GetEndPoint(0)
vector_p2_num = vector_p2.GetEndPoint(1) - vector_p2.GetEndPoint(0)
print(vector_p1_num)
parrarel = vector_p1_num[0]*vector_p2_num[1]-vector_p1_num[1]*vector_p2_num[0]
print("parrarel = {}".format(parrarel))
print("location = {}".format(p1[0].Owner.Location.Curve.Direction))
print(p1[0].Origin[2] - p2[0].Origin[2])
print(parrarel ==0.0)
# ## perpedicular
# p1[0].Origin[0]
# midX_1=(p1[0].Origin[0] + p2[0].Origin[0])/2 # (x1+x2)/2
# midY_1=(p1[0].Origin[1] + p2[0].Origin[1])/2 # (y1+y2)/2
# midZ=p1[0].Origin[2]
# midX_2=midX_1-p2[0].Origin[1]+p1[0].Origin[1] # midX-y2+y1
# midY_2=midY_1+p2[0].Origin[0]-p1[0].Origin[0] # midY + x2-x1
if (p1[0].Origin[2]-p2[0].Origin[2])<0.0000001 and round(parrarel) ==0.0:
print("Create Pipe!!!")
point1 = XYZ(midX_1, midY_1, midZ)
point2 = XYZ(midX_2, midY_2, midZ)
# vector_p1.ComputeClosestPoints(vector_p2, True, True, True, v) # gett error TypeError: expected StrongBox[IList[ClosestPointsPairBetweenTwoCurves]], got ClosestPointsPairBetweenTwoCurves
# print(v)
transaction = Transaction(doc, 'pipe create')
transaction.Start()
Plumbing.Pipe.Create(doc, ElementId(592532), ElementId(142438), ElementId(311), point1, point2)
transaction.Commit()
```