Autodesk.Revit.DB.Reference to Curve


Hello Dynamo people.

I want to create Room Boundary Lines at the location of the reference planes from a family.
In the family I named the Reference Planes "Front"and “Back”.
With Dynamo I can collect these Reference Planes from the family in the project.
Last step is to convert these (Autodesk.Revit.DB.Reference) to Curves or Lines, but i downt know how.
Can anyone help me?

Thanx in advance

import clr
from Autodesk.DesignScript.Geometry import *
import Revit
from Revit.Elements import *
from Autodesk.Revit.DB import *
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
elements = UnwrapElement(IN[0])
par1 = IN[1]
par2 = IN[2]
refs = list()

for el in elements:
doorrefs = list()
refin = FamilyInstance.GetReferenceByName(el, par1)
refex = FamilyInstance.GetReferenceByName(el, par2)


OUT = refs
Reference from FamilyInstance

I was trying with something like this but then if i try to convert both the reference and my test variable to dynamo geometry with .ToProtoType() I got errors…

I remembered having a similar issue but it was the opposite, convertin revit faces to references and I remember the node “RevitFaceReference.FromDynamoSurface”, but I can’t really understand its contenct (can’t find it in the API?) to try and understand what we could do to in orde to do the opposite…

Googling I found this:


I also found this:
Right know I can’t cointinue to try and find out but maybe it’s a start. The NewAlignment method allows you to lock a reference to another (maybe like the lock in Revit’s UI), so maybe you could place a room line and then lock it to your references… ugh

Maybe also this


I am stuck in the same area. What do we do with Autodesk.Revit.DB.Reference as output from the Python. Could anyone please guide us what we should do next?


@Jeremy_Tammik @Zach_Kron Any thoughts?


Simple. Read the docs, my friend.




Away from my PC right now, I have a workflow which might be useful…

I can have more of a look tomorrow.



Edit: I’m thinking of the first Python in there, it converts references to curves and makes them usable in Dynamo with the ToProtoType()… there is also the ToRevitType() method as defined here…


Hello Jeremy! Thanks for the reference. I did try using the doc.GetElement(Reference) method. It simply retrieves the family instance, the parent object where the reference plane resides. I am attempting to gather the reference planes used in the family so I can use Dimension.Byelements without having to create temporary lines if that makes sense. Is it even possible to duplicate the Revit’s way of adding dimensions? By tabbing repeatedly I could get to the same references and use them for dimensions.


yes, retrieving the intenal planes and edges of the family instance sound like the right thing to do and corresponds to the ui tabbing.


You could use these References to create dimensions.
But i was looking for a way to get the geometry of these References to create a Room Boundary Line.
Anyone know how?



(Should probably start a new thread and reference this one)

Is that because you want the boundaries to move with the curves? As if they are locked?

I’m not sure that is possible… The reference is an attribute of the geometry, not the other way round.

You can convert the boundary lines to room boundary curves, but obvs they lose the association. You could probably tweak the graph to delete and recreate the curves to keep them aligned.

Hope that helps,



Does anybody got something in relationship of this in this time? I have the same issue: I’m able to get the references from a family instance and I want to creat a room separator using them, but I’m not able to create a line or a plane from references…


OK, I think I get it:

I have used the method SketchPlane Create(Document, Reference) for creating a plane, and then I can use that plane for creating my lines in the model. I hope it helps.

1 Like

You can also use the FamilyInstance Reference node in Genius Loci package that already includes this feature.