ReferencePlane within Element

dynamo
#1

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
#2

Hi,
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

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

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

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

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

TransactionManager.Instance.EnsureInTransaction(doc)

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

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

TransactionManager.Instance.TransactionTaskDone()
	
OUT = dimension

Let me know if it works

3 Likes
Reference from FamilyInstance