# Line.ByStartPointDirectionLength (Revit API)

**URL:** <https://forum.dynamobim.com/t/line-bystartpointdirectionlength-revit-api/70968>\
**Category:** Developers\
**Tags:** revit, python, dynamo, api\
**Created:** [December 1, 2021, 3:11pm UTC](https://forum.dynamobim.com/t/line-bystartpointdirectionlength-revit-api/70968 "2021-12-01T15:11:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikael.z](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@mikael.z](https://forum.dynamobim.com/u/mikael.z)\
**Post date:** [December 1, 2021, 3:11pm UTC](https://forum.dynamobim.com/t/line-bystartpointdirectionlength-revit-api/70968/1 "2021-12-01T15:11:09Z")

</div>

Hello,

We all recognize this node:  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/1/810b684885d19afcee33cd63f50b75c72a5e3080.png)

My question to you is if any of you know if there is an equivalent function in the Revit API.  
Or possibly how to achieve the same result but in a different way.

I have searched but can not find a method that replaces the ByStartPointDirectionLength node.

Best regards,  
Mikael

---

<div class="post-metadata">

**Author:** ![Brendan\_Cassidy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/brendan_cassidy/32/7685_2.png) [@Brendan\_Cassidy](https://forum.dynamobim.com/u/Brendan_Cassidy)\
**Post date:** [December 1, 2021, 3:33pm UTC](https://forum.dynamobim.com/t/line-bystartpointdirectionlength-revit-api/70968/2 "2021-12-01T15:33:19Z")

</div>

You could create the line with that node, then convert the line that is created into a revit line?

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [December 1, 2021, 3:40pm UTC](https://forum.dynamobim.com/t/line-bystartpointdirectionlength-revit-api/70968/3 "2021-12-01T15:40:40Z")

</div>

An example

```auto
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
#import Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

def lineDB_ByStartPointDirectionLength(pta, vector, length):
	vector = vector.Normalize() * length
	return DB.Line.CreateBound(pta, pta + vector)
	
startPoint = XYZ(1,1,1)
vector = XYZ(1,3,0)
length = 3
line = lineDB_ByStartPointDirectionLength(startPoint, vector, length)	

OUT = line, line.ToProtoType()

```

---

<div class="post-metadata">

**Author:** ![mikael.z](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@mikael.z](https://forum.dynamobim.com/u/mikael.z)\
**Post date:** [December 2, 2021, 9:26am UTC](https://forum.dynamobim.com/t/line-bystartpointdirectionlength-revit-api/70968/4 "2021-12-02T09:26:53Z")

</div>

Thank you @c.poupin !

That was the solution I was looking for 🙂

Best regards,  
Mikael Zeylon
