I have gotten to the PlanarFaces using following code
doc = DocumentManager.Instance.CurrentDBDocument
element = UnwrapElement(IN[0])
options = Autodesk.Revit.DB.Options()
#get element geometry
geometryInstance = element.get_Geometry(options)
#get instance geometry
inst_geom = []
for i in geometryInstance:
inst_geom.append(i.GetInstanceGeometry())
#iterate to remove empty geometry objects
filtered = []
for i in inst_geom[0]:
if list((i.Faces)).Count != 0:
filtered.append(i)
#get faces of filtered geometry
faces = []
for i in filtered:
faces.append(i.Faces)
OUT = faces
This is where the problem starts.
From here I have tried 2 methods to get to the Reference object. Both fail.
Method 1: use face.Reference
#get face reference object
face_refs = []
for face in faces[0]:
face_refs.append(face.Reference)
OUT = face_refs
I get Nulls:
Method 2: use face.Tags.LookupTag(“RevitFaceReference”)