ItemFactoryBase.NewFamilyInstance(Line, FamilySymbol, View) Method

ItemFactoryBaseNewFamilyInstance(Line, FamilySymbol, View) Method

Add a line based detail family instance into the Autodesk Revit document, using an line and a view where the instance should be placed.

Namespace: Autodesk.Revit.Creation
Assembly: RevitAPI (in RevitAPI.dll) Version: 26.0.4.0 (26.0.4.0)
Syntax
public FamilyInstance NewFamilyInstance(
	Line line,
	FamilySymbol symbol,
	View specView
)
Public Function NewFamilyInstance ( 
	line As Line,
	symbol As FamilySymbol,
	specView As View
) As FamilyInstance
public:
FamilyInstance^ NewFamilyInstance(
	Line^ line, 
	FamilySymbol^ symbol, 
	View^ specView
)
member NewFamilyInstance : 
        line : Line * 
        symbol : FamilySymbol * 
        specView : View -> FamilyInstance 

Parameters

line  Line
The line location of family instance. The line must in the plane of the view.
symbol  FamilySymbol
A family symbol object that represents the type of the instance that is to be inserted.
specView  View
A 2D view in which to display the family instance.

Return Value

FamilyInstance
Exceptions
ExceptionCondition
ArgumentNullException Thrown when input argument line or symbol or specView is .
ArgumentException Thrown when input argument line or symbol or specView is invalid, or cannot make such type in the specView, or the line is not in the plane of specView.
InvalidOperationException Thrown when failed to create the instance.
InvalidOperationException Thrown when attempting to place a model-based family. Only 2D detail families can be placed in views.
ArgumentExceptionThrown if The symbol is not active.
Remarks
This overload applies only to 2D family line based detail symbols. 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.
See Also