How to know if an element is a system element, loadable family, model in place element?

How to know if an element is a system element / loadable family / model in place element?

Are there any rules that allow to know that without having to select all the elements of type or similar?

Thanks

Non-system families have an IsInPlace property that you can check. System families don’t have the typical family element that you’d expect as the “family” properties are specific to the system/category. For system elements you can just assume that “no family” means it’s a system element.

2 Likes

it seems complicated as I need to get elements and later the families of the elements, what I see that system families do not have “Family”, I am looking some straight forward way to retrieve the information, that process seems like 3 steps

I tried something like that by now:


That’s just the way it is. You could use Python to get that information much quicker, or even filter elements by type that way.

any example of Python to try?

Here is the IsInPlace property. You would just have to attempt to get the family element for each instance. No family means it’s a system element and IsInPlace will tell you whether it’s in place or loaded.

1 Like

@ruben.romero this could be a start for you!

"""
FILTERED ELEMENT COLLECTOR
"""
__author__ = 'Sol Amour - amoursol@gmail.com'
__twitter__ = '@solamour'
__version__ = '1.0.0'

# Importing Reference Modules
import clr # CLR ( Common Language Runtime Module )
clr.AddReference("RevitServices") # Adding the RevitServices.dll special Dynamo
# module to deal with Revit
import RevitServices # Importing RevitServices
from RevitServices.Persistence import DocumentManager # From RevitServices import
# the Document Manager
clr.AddReference("RevitAPI") # Adding the RevitAPI.dll module to access the Revit
# API
import Autodesk # Here we import the Autodesk namespace
# From the Autodesk namespace - derived down to the Revit Database, we import only
# the Filtered Element Collector and BuiltInCategory classes
from Autodesk.Revit.DB import FilteredElementCollector, FamilyInstance, Family

# Here we give the Revit Document a nickname of 'doc' which allows us to simply
# call 'doc' later without having to type the long namespace name
doc = DocumentManager.Instance.CurrentDBDocument

familyInstanceCollector = FilteredElementCollector(doc).OfClass(FamilyInstance).WhereElementIsNotElementType().ToElements()

systemFamilies = FilteredElementCollector(doc).WhereElementIsElementType().ToElements()

inPlaceFamilies = []

# Collect all InPlace families
for instance in familyInstanceCollector:
symbol = instance.Symbol.Family
if symbol.IsInPlace:
inPlaceFamilies.append(instance)

loadableFamilies = [family for family in familyInstanceCollector if family not in inPlaceFamilies]

# Create a dictionary to output
output = {'inPlaceFamilies' : inPlaceFamilies, 'loadableFamilies' : loadableFamilies, 'systemFamilies' : systemFamilies}

# To get our results back inside of Dynamo, we need to append a list to the OUT port
OUT = output

It’s not perfect, but is a start :

3 Likes

would be ideal for the answer, to feed the python node with a list of elements or families and get as output if those are system, loadable or model/mass in-place instead of getting the elements grouped by a dictionary, because the elements list may come from different documents, not always the current document to do the collector. basically the transpose or opposite output that this sample. :wink: