GetEndPointReference from Dynamo line (Exported from Revit)

Hi All

Can any one direct me to right solution please.

All im trying to do is to get "GetEndPointReference(0) & GetEndPointReference(1) from line in dynamo.

I do extract room boundary lines using this node
image

Than i got Python to get refs from above as below

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

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

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

if isinstance(IN[0], list):
    lines = []
    for i in IN[0]:
        lines.append(UnwrapElement(i))
else:
    lines = [UnwrapElement(IN[0])]


crvs = []
ref = ReferenceArray()

for line in lines:
    crvs.append(line.ToRevitType(True))
for i in crvs:
    ref.Append(i.GetEndPointReference(0))
    ref.Append(i.GetEndPointReference(1))


OUT = crvs,ref

image

All i require is to get start & End points as Revit.DB.Reference fo it can be dimensioned to these points.

Thanks In advance

Regards

I assume you are using this method: GetEndPointReference Method

Note the comments on return value (emphasis added):
Reference to the point or a null reference ( Nothing in Visual Basic) if reference cannot be obtained.

You are pulling the curves from the room boundary in Dynamo which means the curve you’re referencing doesn’t have a source element as rooms don’t have native geometry and as such you cannot reference it. Said another way: you cannot dimension to a room, only the elements which define it.

Instead you’ll need to pull the walls which makes up the boundary, and get a reference to the face at the core boundary of each wall.

4 Likes

Thanks For clarification @jacob.small

1 Like