Family names issue

I want to check all elements of these categories, to see if their Assembly code lines up with the first substring (I use string split on :“_” and get the first item)

But I can’t get consistent Family names as some are Walltypes etc.

Which node can I use or how do I circumvent to get the proper family names?

System elements like walls, ceilings, roofs, etc. don’t have associated Revit Families like the typical loadable family elements. You’ll have to split up your categories and deal with loadable family categories and system categories separately.

If you have something like RevitLookup, you can easily look at the references to see how each element type is associated with its Type and/or Family. That will also show you how to logically get one from the other.

Yeah I got that far, I tried using FilterByBoolMask in combination with Orchid’s IsSystemFamily node. But that only seperates the walls :thinking:

Here is a short bit of python that would get the Types of element system or not, then their assembly codes.

#Sean Page, 2024
import clr

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

clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)

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

doc = DocumentManager.Instance.CurrentDBDocument

elements = UnwrapElement(IN[0])
typeCodes = []
TransactionManager.Instance.EnsureInTransaction(doc)
for elems in elements:
    temp = []
    for e in elems:
        type = doc.GetElement(e.GetTypeId())
        temp.append(type.LookupParameter("Assembly Code").AsString())
    typeCodes.append(temp)
TransactionManager.Instance.TransactionTaskDone()

OUT = typeCodes
1 Like

Show us what you’ve done then. We can’t give you any better suggestions if we don’t know what you’re doing or what your exact issue is at the moment.

You’re better off separating the categories yourself, but you should be able to do it with a filter if that’s the way you want to go.

tl;dr I am developing a script to check if the Assembly Code correctly updated in the Family Name (not type name). I am stuck with how to split the System Families from the Loadable Families.

Context

Yeah I think a filter would be best too.

In Netherlands we use NL-SfB code. We abuse the Assembly Code parameter for this.
We recently upgraded to using the full code instead of the first 2 digits.

So I need to correct some of the families.

I think the SystemFamily.IsTypeOf is for Systems such as Pipes etc.

I just want to get the proper name and have the user manually select through a Data Shapes menu which names they approve of changing.

Whether the Assembly Codes are updated themselves will be a different script.

It looks like you’re able to get the Family Name from the ElementTypes, so what’s the exact issue that you’re having? System elements will have a system family name but you won’t be able to get that family as an element in the same way that you can with loadable family elements. From what I understand from your explanation, you don’t need the actual element though. The type should be what you need to get/set the Assembly Code.

Oh wow I just realized I can just ignore it and the System/Loadable by checking the Family Name and using this test: