# Not working "Family.load" for multiple nested families

**URL:** <https://forum.dynamobim.com/t/not-working-family-load-for-multiple-nested-families/99288>\
**Category:** Revit\
**Tags:** dynamo\
**Created:** [March 21, 2024, 7:15am UTC](https://forum.dynamobim.com/t/not-working-family-load-for-multiple-nested-families/99288 "2024-03-21T07:15:24Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![fayazmohd144](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@fayazmohd144](https://forum.dynamobim.com/u/fayazmohd144)\
**Post date:** [March 21, 2024, 7:15am UTC](https://forum.dynamobim.com/t/not-working-family-load-for-multiple-nested-families/99288/1 "2024-03-21T07:15:24Z")

</div>

Hi dynamo community, @c.poupin, @jacob.small

While running the script, the parameter values are successfully updated in the family document. However, when attempting to reload the families in Revit by using “Family.load” node, it shows an error as shown in the blown-up image below

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/c/2cf0f4cd47a9154fc86f2412ddd8c1f4e4f1764a.png)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/8/b87a2960d8a3a8b4ba5dfabc625607263d908cbf.png)  
Blownup Image

Please review our attached images and sample dynamo files and Revit files and give us any suggestions so that it will be very helpful to our project.  
[Demo (Nested).dyn](https://forum.dynamobim.com/uploads/short-url/b2H99y40ROzY8M5oQStdFFcPRl0.dyn) (44.0 KB)

 ![Demo (Nested)](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/7/672c98ea1dd660a4658721e6eaaf738c47a92ef0.png)

[Demo project1.rvt](https://forum.dynamobim.com/uploads/short-url/ArWDbgrfAb38qNMwAxwKKMQHvtM.rvt) (2.0 MB)

Also, we have tried in python script but it’s not working please check our python script node as shown in below and provide any suggestion so that it will be very helpful to our project.

```auto
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

#Inputs is stored in the IN variable
elements = IN[0]

#Ensure loaded families can overwrite existing families.
class FamilyOption(IFamilyLoadOptions) :
def OnFamilyFound(self, familyInUse, overwriteParameterValues) :
	overwriteParameterValues = True
	return True

def OnSharedFamilyFound(self, sharedFamily, familyInUse, source, overwriteParameterValues) :
	return True

#Core data processing
TransactionManager.Instance.EnsureInTransaction(doc)
try:
for fam in elements :
	fam.LoadFamily(doc, FamilyOption())
except:
pass
TransactionManager.Instance.TransactionTaskDone()

#Nothing assign to the OUT variable
OUT = 'Families is updatet/reloaded'

```

---

<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:** [March 21, 2024, 7:54am UTC](https://forum.dynamobim.com/t/not-working-family-load-for-multiple-nested-families/99288/2 "2024-03-21T07:54:57Z")

</div>

Hi,

- **for the Family.Load node**

try to flat the list before

- **for the Python code**

Cpython3/PythonNet2 do not work well with interfaces, use IronPython instead ([with this specifc syntax](https://forum.dynamobim.com/t/how-do-i-define-a-family-parameter-in-revitapi-2024-using-python-block-in-designscript/89816/16)) or build a Zero Touch Node (C#)

---

<div class="post-metadata">

**Author:** ![fayazmohd144](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@fayazmohd144](https://forum.dynamobim.com/u/fayazmohd144)\
**Post date:** [March 21, 2024, 10:20am UTC](https://forum.dynamobim.com/t/not-working-family-load-for-multiple-nested-families/99288/3 "2024-03-21T10:20:43Z")

</div>

Hi poupin,

Thank you for the response., Already we have used the flatten list for the family.load node, still its showing error as shown in below screenshot in dynamo script.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/b/7bb52b9d67df15392c5057459852b1948181d4dd.png)  
For sample files please use above attached files only

For python script:  
I’m just a beginner in Python scripting. Could you please check and update my Python script as shown below? It would be very helpful for my project.  
import clr  
import sys  
import System  
from System.Collections.Generic import List

### ------------- Import RevitAPI -----------------------------------------###

clr.AddReference(“RevitAPI”)  
clr.AddReference(“RevitAPIUI”)  
import Autodesk  
from Autodesk.Revit.DB import \*  
import Autodesk.Revit.DB as DB

### ------------- Import DocumentManager y TransactionManager -------------###

clr.AddReference(“RevitServices”)  
import RevitServices  
from RevitServices.Persistence import DocumentManager  
from RevitServices.Transactions import TransactionManager  
from System.Collections.Generic import \*

### ------------- Here all Definitions --------------------------------------###

# tolist() function to ensure that the element is iterable

### ------------- Current document and User Interface. ----------------------###

doc = DocumentManager.Instance.CurrentDBDocument

##class for Load ##   
class FamilyOption(IFamilyLoadOptions) :  
def OnFamilyFound(self, familyInUse, overwriteParameterValues):  
overwriteParameterValues.Value = True  
return True

```
def OnSharedFamilyFound(self, sharedFamily, familyInUse, source, overwriteParameterValues):
	overwriteParameterValues.Value = True
	return True	

```

# preparing input

familydoc = IN[0]

TransactionManager.Instance.ForceCloseTransaction()

for famDoc in familydoc:

```
# load to Project and close
famDoc.LoadFamily(doc, FamilyOption())
familyDoc.Close(False)

```

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [March 21, 2024, 10:30am UTC](https://forum.dynamobim.com/t/not-working-family-load-for-multiple-nested-families/99288/4 "2024-03-21T10:30:28Z")

</div>

Hi @fayazmohd144 I guess that node expect an autodek.revit.db.document…maybe

---

<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:** [March 21, 2024, 10:36am UTC](https://forum.dynamobim.com/t/not-working-family-load-for-multiple-nested-families/99288/5 "2024-03-21T10:36:08Z")

</div>

I think that is one of the Orchid nodes, which means it might expect an Orchid document. Best to head over to the [Orchid Package](https://github.com/erfajo/OrchidForDynamo) GitHub repository for support if so.

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [March 21, 2024, 10:38am UTC](https://forum.dynamobim.com/t/not-working-family-load-for-multiple-nested-families/99288/6 "2024-03-21T10:38:43Z")

</div>

yeah guess you are right 😉 😉 i dont know these nodes, i thought it was genius loci…

---

<div class="post-metadata">

**Author:** ![fayazmohd144](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@fayazmohd144](https://forum.dynamobim.com/u/fayazmohd144)\
**Post date:** [March 21, 2024, 11:08am UTC](https://forum.dynamobim.com/t/not-working-family-load-for-multiple-nested-families/99288/7 "2024-03-21T11:08:25Z")

</div>

Hi Jacob

Thank you for the response, but this node is worked on normal family’s but it is not working in nesting family’s, please check above attached files and do needful my requirement. it will be very helpful for my project

---

<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:** [March 21, 2024, 11:13am UTC](https://forum.dynamobim.com/t/not-working-family-load-for-multiple-nested-families/99288/8 "2024-03-21T11:13:06Z")

</div>

> [@fayazmohd144](#):
>
> this node is worked on normal family’s but it is not working in nesting family’s

Which means it’s a problem with the Orchid node, which means we can’t help without rebuilding the entire graph to not use the Orchid node or perhaps the package at all as it doesn’t play well with others. It’s not as simple as ‘change this one thing’ when we can’t edit the one thing. The [Orchid Package](https://github.com/erfajo/OrchidForDynamo) author can, so that’s why I redirected you to that GitHub.

---

<div class="post-metadata">

**Author:** ![fayazmohd144](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@fayazmohd144](https://forum.dynamobim.com/u/fayazmohd144)\
**Post date:** [March 22, 2024, 6:01am UTC](https://forum.dynamobim.com/t/not-working-family-load-for-multiple-nested-families/99288/9 "2024-03-22T06:01:27Z")

</div>

Hi jacob  
Thank you for the response, we got the solution for your suggestion.
