I’m totally confused about getting the value of Line.Direction in the Revit API compared to DesignScript!
Considering the example in the image below (and taking into account unit conversion to Revit internal units), the Revit API gives an incorrect result for line.Direction, which should be: (5 * 0.3048 = 1.524, 5 * 0.3048 = 1.524, 0).
It’s not a unit issue. The Revit API returns the unit vector (length = 1) whereas Dynamo returns the full vector (length = 5*sqrt(2)). You can multiply or divide by the line length to go between the two.
I believe the documentation for those methods has the answer which you seek. Something along the lines of ‘if the second derivative cannot be determined the result will be null or a zero length vector’, but best to check on your own.