Search code examples
revit-apirevitrevitpythonshellpyrevit

How to get create a vector from a curve?


Maybe I'm misunderstanding the concept of 'curve' in Revit API, but I'm basically trying to create a vector from a curve. What I was guessing was creating a vector from both end points of the curve(using GetEndPoint class), but it seems like it's not a thing in Revit API.

I need you guys' help! Thanks!


Solution

  • XYZ pstart = Curve.GetEndPoint(0) # start XYZ point
    XYZ pend = Curve.GetEndPoint(1) # end XYZ point
    XYZ v = (pend - pstart).Normalize() # normalised vector pointing along curve