Reload Family and overwrite parameter values


Hello everyone,

I have a problem when I used below code to reload families. The families were loaded but graphic only(Overwrite the existing version) . Type Parameters were not overwrite. I checked in this code and find out the variable “overwriteParameterValues” is True. When I changed to False , the families could not be loaded.

Many thanks,

Load multiple families from a folder

import clr
from Autodesk.Revit.DB import *

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
for element in elements :
	doc.LoadFamily(element, FamilyOption())

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


Hi erfajo,
Thank for you help, I think the old code is faster than the update. You don’t need open the many family files. In case you want to load many families in many documents, the first is more productive.
If you have any suggestions about Overwrite Parameter values, please inform me. I really need it now.

Thank you.



I tested your old code in Dynamo, It work well. But when I tested in Revit Add-in, It not work. It work only with new code.As you said the syntax is old, but both Dynamo and Revit add in use Revit API. I don’t know what are differents.



Hi…would the topic below your deemed to be the ultimate goal? Im just asking.



@4bimfercesp, the syntax @Einar_Raknes uses in that post will not overwrite present families… Thats why I made the node in the first place, to ensure families were loaded. Besides is the syntax also the wrong one, which I also used until recently.

This is the correct use in the post by @Einar_Raknes
public Family LoadFamily( Document targetDocument )

This is the way if you want to overwrite present families.
public Family LoadFamily( Document targetDocument, IFamilyLoadOptions familyLoadOptions )

1 Like


thanks for this code @erfajo!
I was afraid i might have to fire up visual studio in order to implement an interface. Awesome that a python class can inherit an interface. i never would have known…:astonished:



Thanks for the very helpful discussion.