ItemFactoryBaseNewFamilyInstance(Reference, Line, FamilySymbol) Method |
Inserts a new instance of a family onto a face referenced by the input Reference instance,
using a line on that face for its position, and a type/symbol.
Namespace: Autodesk.Revit.CreationAssembly: RevitAPI (in RevitAPI.dll) Version: 26.0.4.0 (26.0.4.0)
Syntaxpublic FamilyInstance NewFamilyInstance(
Reference reference,
Line position,
FamilySymbol symbol
)
Public Function NewFamilyInstance (
reference As Reference,
position As Line,
symbol As FamilySymbol
) As FamilyInstance
public:
FamilyInstance^ NewFamilyInstance(
Reference^ reference,
Line^ position,
FamilySymbol^ symbol
)
member NewFamilyInstance :
reference : Reference *
position : Line *
symbol : FamilySymbol -> FamilyInstance
Parameters
- reference Reference
- A reference to a face.
- position Line
- A line on the face defining where the symbol is to be placed.
- 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 or CurveBased.
Return Value
FamilyInstanceAn instance of the new object if creation was successful, otherwise
.
ExceptionsException | Condition |
---|
ArgumentNullException | Thrown when a non-optional argument was null. |
ArgumentException | Thrown when the function
cannot get a face from the reference, or, when the family
cannot be placed as line-based on an input face reference, because its FamilyPlacementType is not WorkPlaneBased or
CurveBased |
ArgumentsInconsistentException | Thrown when the family cannot be placed on
this line as it does not coincide with the input face. |
InvalidOperationException | Thrown when Revit is unable to place the family
instance. |
ArgumentException | Thrown if The symbol is not active. |
RemarksUse this method to insert one family instance on a face of another element,
using a line on the face 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 instance fails to be created an exception may be thrown.
Note: if the created family instance includes nested instances, the API framework will automatically regenerate
the document during this method call.
See Also