Document.LoadFamily(String, IFamilyLoadOptions, Family) Method

DocumentLoadFamily(String, IFamilyLoadOptions, Family) Method

Loads an entire family and all its types/symbols into the document and provides a reference to the loaded family.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 26.0.4.0 (26.0.4.0)
Syntax
public bool LoadFamily(
	string filename,
	IFamilyLoadOptions familyLoadOptions,
	out Family family
)
Public Function LoadFamily ( 
	filename As String,
	familyLoadOptions As IFamilyLoadOptions,
	<OutAttribute> ByRef family As Family
) As Boolean
public:
bool LoadFamily(
	String^ filename, 
	IFamilyLoadOptions^ familyLoadOptions, 
	[OutAttribute] Family^% family
)
member LoadFamily : 
        filename : string * 
        familyLoadOptions : IFamilyLoadOptions * 
        family : Family byref -> bool 

Parameters

filename  String
The fully qualified filename of the Family file, usually ending in .rfa.
familyLoadOptions  IFamilyLoadOptions
The interface implementation to use when loading a family into the document.
family  Family
A reference to the family that was loaded if successful, otherwise Nothing.

Return Value

Boolean
True if the entire family was loaded successfully into the project, otherwise False.
Exceptions
ExceptionCondition
ArgumentException Thrown when filename is or empty.
ArgumentNullException Thrown when the input argument "familyLoadOptions" is .
Remarks

Loading an entire family may take a considerable amount of time and memory. It is recommended that you use one of the LoadFamilySymbol() methods and only load those symbols that you need.

See Also