Shortest distance between two non-intersecting lines

Hi all,

Is there any way to find the shortest distance between 2 lines that do not intersect? For instance, you would see them crossing on plan view, but they would appear parallel on a side view. In other words the planes containing the lines are parallel.

However, it is not as simple as finding the distance between the planes, I need to be sure they would intersect if one line is projected to a parallel plane containing the second line.

Well in my case both lines would be on horizontal planes (XY)

I would like to do this in Grasshopper.

TIA

Output ā€œDā€ of Curve Proximity

Thank you! This works like a charm.

Very elegant solution, Thank you so much!