Get Type from FamilySymbol

Hi Everyone . I’m trying to get the Type Name from Family Symbol but the result is an empty list. Is there a way I can get the Type “300 x 600mm” from a list of 2 types (0 List)? Please help me. Thanks everyone…!

import clr
import System
from System.Collections.Generic import *

clr.AddReference("ProtoGeometry")
from Autodesk.DesignScript.Geometry import *

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

clr.AddReference("RevitAPIUI")
from Autodesk.Revit.UI import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

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

doc = DocumentManager.Instance.CurrentDBDocument
view = doc.ActiveView


filterframing = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_StructuralFraming).WhereElementIsElementType().ToElements()
framingUse = []
for i in filterframing:
    if i.Family.Name == "M_Concrete-Rectangular Beam" :
        framingUse.append(i)
typeframing = []
for i in framingUse:
    if i.GetType().ToString() == "300 x 600mm":
        typeframing.append(i)

OUT = framingUse,typeframing


Help me

Hi @bimtechgts

To get the name of a Family Type, you can use the BuiltInParameters
000156

import clr
import System
from System.Collections.Generic import *

clr.AddReference("ProtoGeometry")
from Autodesk.DesignScript.Geometry import *

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

clr.AddReference("RevitAPIUI")
from Autodesk.Revit.UI import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

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

doc = DocumentManager.Instance.CurrentDBDocument
view = doc.ActiveView

#Get all the Family Types (Family Symbols in the Project)
allFramingTypesInProject = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_StructuralFraming).WhereElementIsElementType().ToElements()

framingTypeNames = []
params = []
for type in allFramingTypesInProject:
	#Get the Family Type Name Parameter
	parameter = type.get_Parameter(BuiltInParameter.SYMBOL_NAME_PARAM)
	
	#Get the Value of the Parameter --> The Name
	typeName = parameter.AsString()
	
	#Add the Name to the Output List
	framingTypeNames.append(typeName)

OUT = allFramingTypesInProject, framingTypeNames
2 Likes

I don’t believe GetType() is a valid method. Plus, your list is already of the FamilySymbols, you just need to get the name from them at that point (as you can see in @Joelmick’s code).