Select Electric Panelboards, not all Electrical Equipment

The only thing (I can find) they have in common is: their family name contains “Panel.” Doesn’t seem like there is a node to select all elements and filter by “Family name contains.” I am having a hard time even creating a list of Electrical Equipment Family Names to parse. Anyone been thru this?

BTW I discovered that the Family.Name node seems broken. It doesn’t actually report the family name, it reports the Family TYPE name.

Likely if you get the family type of the instance, and the parent family of that family type you’ll get a way to filter to the collection you’re after.

Yup, the family name does appear a bit on the munted side in my experience as we’d say down under. I usually take the expanded type/family name and split as a string at the substring "Family: " and take the end then search that for the match.

See below for an example which runs on the basic sample project:

sofa finder.dyn (17.8 KB)

Hi,
we can filter Electrical Equipments, checking a Family parameter (‘Part Type’)

import clr
import sys
import System
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
import Autodesk.DesignScript.Geometry as DS

#import Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB
from Autodesk.Revit.DB.Electrical import *

#import transactionManager and DocumentManager (RevitServices is specific to Dynamo)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
uidoc = uiapp.ActiveUIDocument
app = uiapp.Application


filterPanel = System.Predicate[System.Object](lambda e : e.Symbol.Family.get_Parameter(BuiltInParameter.FAMILY_CONTENT_PART_TYPE).AsInteger() == 14)
all_panels = FilteredElementCollector(doc)\
			.OfCategory(BuiltInCategory.OST_ElectricalEquipment)\
			.WhereElementIsNotElementType()\
			.ToElements()\
			.FindAll(filterPanel)

OUT = all_panels
1 Like