Hi All,
Does anyone know how to get all the element’s “Family Type”,“Family” from current doc [IN PYTHON]?
Basically i am after the node “Element.ElementType” in Python.
Thanks in advance!
Cheers,
Hi All,
Does anyone know how to get all the element’s “Family Type”,“Family” from current doc [IN PYTHON]?
Basically i am after the node “Element.ElementType” in Python.
Thanks in advance!
Cheers,
doc.GetElement(elem.GetTypeId())
Hi @SeanP
Thanks for the quick response
Unsure, what i am doing wrong, can you please advise?
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
#The inputs to this node will be stored as a list in the IN variables.
#Get the project document.
doc = DocumentManager.Instance.CurrentDBDocument
elem = IN[0]
doc.GetElement(elem.GetTypeId())
You need to iterate the list to get the singular values. It may be good to review some of the Primer materials related to Python before trying to go too far into this approach.
elems = UnwrapElement(IN[0])
results = []
for elem in elems:
results.append(doc.GetElement(elem.GetTypeId()))
OUT = results
Thanks @SeanP