Call FamilyType.ByFamilyNameAndTypeName from Python Node

Hi,
I am newbee in Python and APIs so sorry if this question too silly.
How can I call FamilyType.ByFamilyNameAndTypeName function from Python?

I’ve tried code like this, but faced with “AttributeError: ‘Autodesk.Revit’ object has no attribute ‘Elements’” issue.

# The inputs to this node will be stored as a list in the IN variables.
tp = IN[0]

# Place your code below this line
get_fam = Autodesk.Revit.Elements.FamilyType.ByFamilyNameAndTypeName('Wall_Junction_Type_Test', 'T')

# Assign your output to the OUT variable.
OUT = get_fam

That’s stange because prompt gave me a hint to select “Elements”. My logic to find apropriate node was following: I followed through the every category and subcategory to the place where node belongs to separated by point.

Hi,

What is your input? (IN[0])
What is it that you want?
Did you import the sys?

Hi, @jw.vanasselt
Information from IN[0] is not my input. I hardcoded family name and family type.
Yes, I used to import sys.

Hello,
you have some missing library import

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

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

# Place your code below this line
get_fam = Revit.Elements.FamilyType.ByFamilyNameAndTypeName('M_Double-Flush', '1730 x 2134mm')

# Assign your output to the OUT variable.
OUT = get_fam
3 Likes

Thank you!