Im trying to get the distance between 2 Points in python, But its returning this error
i also tried this, but it returns 0
Im trying to get the distance between 2 Points in python, But its returning this error
i also tried this, but it returns 0
Tried this from another post, it works but still returns 0.
A simple test scenario works fine for me. Try a simplified version on two points and make sure it’s not some rounding/scaling issue (shouldn’t be though, should return a double). I’m guessing the issue is something else in your code, not that particular line. Can you show us more of what you’re doing?
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('DSCoreNodes')
from DSCore import *
#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
sPoint = IN[0]
ePoint = IN[1]
dist = sPoint.DistanceTo(ePoint)
#Assign your output to the OUT variable.
OUT = dist
Yes i fixed it, it was something else in the Code.