# Call FamilyType.ByFamilyNameAndTypeName from Python Node

**URL:** <https://forum.dynamobim.com/t/call-familytype-byfamilynameandtypename-from-python-node/79888>\
**Category:** Developers\
**Tags:** revit, python, geometry\
**Created:** [August 15, 2022, 10:37am UTC](https://forum.dynamobim.com/t/call-familytype-byfamilynameandtypename-from-python-node/79888 "2022-08-15T10:37:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![denisyukj](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/denisyukj/32/166182_2.png) [@denisyukj](https://forum.dynamobim.com/u/denisyukj)\
**Post date:** [August 15, 2022, 10:37am UTC](https://forum.dynamobim.com/t/call-familytype-byfamilynameandtypename-from-python-node/79888/1 "2022-08-15T10:37:17Z")

</div>

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.

```auto
# 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.

---

<div class="post-metadata">

**Author:** ![jw.vanasselt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jw.vanasselt/32/133533_2.png) [@jw.vanasselt](https://forum.dynamobim.com/u/jw.vanasselt)\
**Post date:** [August 15, 2022, 11:54am UTC](https://forum.dynamobim.com/t/call-familytype-byfamilynameandtypename-from-python-node/79888/2 "2022-08-15T11:54:37Z")

</div>

Hi,

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

---

<div class="post-metadata">

**Author:** ![denisyukj](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/denisyukj/32/166182_2.png) [@denisyukj](https://forum.dynamobim.com/u/denisyukj)\
**Post date:** [August 15, 2022, 11:57am UTC](https://forum.dynamobim.com/t/call-familytype-byfamilynameandtypename-from-python-node/79888/3 "2022-08-15T11:57:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [August 15, 2022, 1:05pm UTC](https://forum.dynamobim.com/t/call-familytype-byfamilynameandtypename-from-python-node/79888/4 "2022-08-15T13:05:50Z")

</div>

Hello,  
you have some missing library import

```auto
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

```

---

<div class="post-metadata">

**Author:** ![denisyukj](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/denisyukj/32/166182_2.png) [@denisyukj](https://forum.dynamobim.com/u/denisyukj)\
**Post date:** [August 15, 2022, 2:11pm UTC](https://forum.dynamobim.com/t/call-familytype-byfamilynameandtypename-from-python-node/79888/5 "2022-08-15T14:11:46Z")

</div>

Thank you!
