ItemFactoryBase.NewFamilyInstance(Face, XYZ, XYZ, FamilySymbol) Method

ItemFactoryBaseNewFamilyInstance(Face, XYZ, XYZ, FamilySymbol) Method

Inserts a new instance of a family onto a face of an existing element, using a location, reference direction, and a type/symbol.

Namespace: Autodesk.Revit.Creation
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)
Syntax
public FamilyInstance NewFamilyInstance(
	Face face,
	XYZ location,
	XYZ referenceDirection,
	FamilySymbol symbol
)
Public Function NewFamilyInstance ( 
	face As Face,
	location As XYZ,
	referenceDirection As XYZ,
	symbol As FamilySymbol
) As FamilyInstance
public:
FamilyInstance^ NewFamilyInstance(
	Face^ face, 
	XYZ^ location, 
	XYZ^ referenceDirection, 
	FamilySymbol^ symbol
)
member NewFamilyInstance : 
        face : Face * 
        location : XYZ * 
        referenceDirection : XYZ * 
        symbol : FamilySymbol -> FamilyInstance 

Parameters

face  Face
A face of a geometry object.
location  XYZ
Point on the face where the instance is to be placed.
referenceDirection  XYZ
A vector that defines the direction of the family instance. Note that this direction defines the rotation of the instance on the face, and thus cannot be parallel to the face normal.
symbol  FamilySymbol
A FamilySymbol object that represents the type of the instance that is to be inserted. Note that this symbol must represent a family whose FamilyPlacementType is WorkPlaneBased.

Return Value

FamilyInstance
An instance of the new object if creation was successful, otherwise .
Exceptions
ExceptionCondition
ArgumentNullExceptionThrown when a non-optional argument was null.
ArgumentExceptionThrown when the function cannot get the Reference from the face, or, when the Family cannot be placed as line-based on an input face reference, because its FamilyPlacementType is not WorkPlaneBased
ArgumentsInconsistentExceptionThrown when reference direction is parallel to face normal at insertion point.
InvalidOperationExceptionThrown when Revit is unable to place the family instance.
ArgumentExceptionThrown if The symbol is not active.
Remarks
Use this method to insert one family instance on a face of another element, using a point on the face and a vector to define the position and direction of the new symbol.

The type/symbol that is used must be loaded into the document before this method is called. Families and their symbols can be loaded using the Document.LoadFamily or Document.LoadFamilySymbol methods.

The host object must support insertion of instances, otherwise this method will fail. If the instances fails to be created an exception may be thrown.

Some Families, such as Beams, have more than one endpoint and are inserted in the same manner as single point instances. Once inserted, these linear family instances can have their endpoints changed by using the instance's Element.Location property.

Note: if the created family instance includes nested instances, the API framework will automatically regenerate the document during this method call.

See Also