LoadFamily Method (Document)


Document Load Family(Document) Method

Loads the contents of this family document into another document.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public Family LoadFamily(
	Document targetDocument
)

Parameters

targetDocument Document
The target document where the family will be loaded.

Return Value

Family
Reference of the family in the target document.
Exceptions
Exception Condition
ArgumentNullException Thrown when the input argument-"targetDocument"-is .
InvalidOperationException Thrown when the current document is not a family document, or when the target document is modifiable (e.g. there is an uncommitted transaction) or doesn't support load of this kind of families (e.g. loading a model family to detail family is disallowed), or when this family was found in the target document already and the conflict caused an automatic abort of the load operation, or when a shared family in this family was found in the target document already and the conflict caused an automatic abort of the load operation, or this document is currently in a read-only state.
ForbiddenForDynamicUpdateException Thrown if this method is called during dynamic update.
Remarks
If you are reloading an edited family back into the source document from which it was extracted, this method will always fail. This is because this method automatically suppresses the prompts Revit typically uses to deal with conflicts between families, and assumes that any such conflict should prevent the loading. If you want to be able to reload the same family into the source document, you should use the LoadFamily() overload accepting IFamilyLoadOptions .
See Also