# 'FamilyInstance' object has no attribute 'Parameters' on CPython3

**URL:** <https://forum.dynamobim.com/t/familyinstance-object-has-no-attribute-parameters-on-cpython3/82747>\
**Category:** Revit\
**Tags:** python, dynamo, cpython3\
**Created:** [November 4, 2022, 12:04pm UTC](https://forum.dynamobim.com/t/familyinstance-object-has-no-attribute-parameters-on-cpython3/82747 "2022-11-04T12:04:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![CarlosCMB](https://avatars.discourse-cdn.com/v4/letter/c/7bcc69/32.png) [@CarlosCMB](https://forum.dynamobim.com/u/CarlosCMB)\
**Post date:** [November 4, 2022, 12:04pm UTC](https://forum.dynamobim.com/t/familyinstance-object-has-no-attribute-parameters-on-cpython3/82747/1 "2022-11-04T12:04:29Z")

</div>

Hello Dynamaniacs!

I’m migrating my Scripts from IronPython2 to CPython3 and I have this problem:

The following code works perfectly on IronPython2, but it throws this error when I run it under CPython 3

AttributeError : ‘FamilyInstance’ object has no attribute ‘Parameters’ [’ File “”, line 30, in \n’]

Does anybody have an Idea, what the solution could be?

```auto
import clr

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

clr.AddReference("RevitAPI")
from Autodesk.Revit.DB 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
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

roomgroups = UnwrapElement(IN[1])
tops = UnwrapElement(IN[2])
niches = IN[0]

output = []
tosum = []

TransactionManager.Instance.EnsureInTransaction(doc)

for ix, roomgroup in enumerate(roomgroups):
	top_pars = tops[ix].Parameters
	for ix2, room in enumerate(roomgroup):
		area = room.LookupParameter("Fläche").AsDouble()
		topo_name = room.LookupParameter("Topo_RaumName").AsString()
		if topo_name != "Balkon" \
		or topo_name != "Garten" \
		or topo_name != "Loggia" \
		or topo_name != "Terrasse":
			tosum.append(area)
		for par in top_pars:
			try:
				if topo_name in par.Definition.Name:
					par.Set(area)
			except:
				pass
	par_area = tops[ix].LookupParameter("FP_Top_Fläche")
	par_area.Set(sum(tosum))
	tosum = []

TransactionManager.Instance.TransactionTaskDone()
OUT = output

```

---

<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:** [November 4, 2022, 1:51pm UTC](https://forum.dynamobim.com/t/familyinstance-object-has-no-attribute-parameters-on-cpython3/82747/2 "2022-11-04T13:51:08Z")

</div>

it’s strange 😳, it looks like PythonNet doesn’t always manage to go up the inheritance tree (methods and properties)  
_this is the 2nd time I see this problem_

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [November 5, 2022, 7:01am UTC](https://forum.dynamobim.com/t/familyinstance-object-has-no-attribute-parameters-on-cpython3/82747/3 "2022-11-05T07:01:56Z")

</div>

Hi @CarlosCMB

> [@CarlosCMB](#):
>
> it throws this error when I run it under CPython 3
> 
> AttributeError : ‘FamilyInstance’ object has no attribute ‘Parameters’ [’ File “”, line 30, in \n’]

I don’t see the same error for me in CPython3 🤔

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/8/68d57d92585ed5f1cf7642bf2b28da62a9792328.png)

Possible to share relevant rvt and dyn file?

---

<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:** [November 5, 2022, 10:42am UTC](https://forum.dynamobim.com/t/familyinstance-object-has-no-attribute-parameters-on-cpython3/82747/4 "2022-11-05T10:42:37Z")

</div>

@CarlosCMB  
What’s your config?

- Windows version?
- Revit version?,
- Dynamo version?
- run on Virtual machine?

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [November 5, 2022, 5:21pm UTC](https://forum.dynamobim.com/t/familyinstance-object-has-no-attribute-parameters-on-cpython3/82747/5 "2022-11-05T17:21:46Z")

</div>

Feels like the imports not being setup is impacting this…

Edit: Curious what options are exposed via dir(elem) both with and without the imports; somehow it feels like the answer will be in that set.
