Distance between line and Point Python

Oh man, yes! :slight_smile: First of all you only need to import Revit stuff and do the unwrapping parts if you’re dealing with the Revit API, which in your case you are not.
Since the Dynamo geometry library is “preloaded” with the builtin python template already, all you need to do is this:

# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN

# Place your code below this line
pnt = IN[0]
line = IN[1]

result = pnt.DistanceTo(line)
# Assign your output to the OUT variable.
OUT = result
1 Like