Help with Curve method ComputeClosestPoints

Hello everyone, is there a way to set the parameter out IList for the Curve class metho ComputeClosestPoints in python?

I tried to find the resulting ClosestPointsPairBetweenTwoCurves for two lines, but i dont know how to set this parameter, here is what i try.

First:

#Code begins here
pt1 = XYZ(0, 0, 0)
pt2 = XYZ(10, 0, 0)
pt3 = XYZ(0, 7, 0)
p4 = XYZ(10, 15, 0)
ln1 = Line.CreateBound(pt1, pt2)
ln2 = Line.CreateBound(pt3, p4)
resLst = []
clstPts = ln1.ComputeClosestPoints(ln2, True, True, False, resLst)

Throws this exception (I know resLst cant be a list, just for show the expected input type…
TypeError: expected StrongBox[IList[ClosestPointsPairBetweenTwoCurves]], got list

Second, changir resLst to:

resLst = clr.Reference[List[ClosestPointsPairBetweenTwoCurves]]()

Throws this exception:
TypeError: expected StrongBox[IList[ClosestPointsPairBetweenTwoCurves]], got StrongBox[List[ClosestPointsPairBetweenTwoCurves]]

Last:
Changing resLst to:

resLst = clr.Reference[IList[ClosestPointsPairBetweenTwoCurves]]([ClosestPointsPairBetweenTwoCurves()])

In this case the method seems to work, pyrevit dosnt throw any exception but the result is null.

Any help will be appreciated.

Regards.

When I don’t know how to understand such issues I tend to look for examples on GitHub

Then go through C# and python code samples

You should also look at the constructor on apidocs website to understand better expected inputs and outputs