ReferencePlane within Element


Hello everyone,

I am trying create automatic measurements within Dynamo on a Revit project.
Now I am struggeling to get the ReferencePlanes out of an Element. I didnt find any node to select the Reference Plane of an Element?

Any help would be appreciated.
Thanks :slight_smile:

these are my families. (This dimensions are done by hand)

and here you can see there are Reference planes inside which I want to select.

my Skript so far:

How to get the Reference planes out of Elements to put it into “referenceElements”?

Create dimensions

you can get the reference planes with the method FamilyInstance.GetReferenceByName and indicate which reference you want, in this case I took “Center (Left/Right)”.

Apparently the node you are using takes only model lines as reference, so it’s just easier to use doc.Create.NewDimension in Python, it’s basically working in the same way.

import clr

from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

element = UnwrapElement(IN[0])
line = UnwrapElement(IN[1]).GeometryCurve
ref = ReferenceArray()


#Get Reference Planes from Families
for x in element:
	a = FamilyInstance.GetReferenceByName(x,"Center (Left/Right)")

#Create Dimension
dimension = doc.Create.NewDimension(doc.ActiveView,line,ref)

OUT = dimension

Let me know if it works

Reference from FamilyInstance