ItemFactoryBaseNewFamilyInstance(XYZ, FamilySymbol, XYZ, Element, StructuralType) Method |
Inserts a new instance of a family into the document,
using a location, type/symbol, the host element and a reference direction.
Namespace: Autodesk.Revit.CreationAssembly: RevitAPI (in RevitAPI.dll) Version: 26.0.4.0 (26.0.4.0)
Syntaxpublic FamilyInstance NewFamilyInstance(
XYZ location,
FamilySymbol symbol,
XYZ referenceDirection,
Element host,
StructuralType structuralType
)
Public Function NewFamilyInstance (
location As XYZ,
symbol As FamilySymbol,
referenceDirection As XYZ,
host As Element,
structuralType As StructuralType
) As FamilyInstance
public:
FamilyInstance^ NewFamilyInstance(
XYZ^ location,
FamilySymbol^ symbol,
XYZ^ referenceDirection,
Element^ host,
StructuralType structuralType
)
member NewFamilyInstance :
location : XYZ *
symbol : FamilySymbol *
referenceDirection : XYZ *
host : Element *
structuralType : StructuralType -> FamilyInstance
Parameters
- location XYZ
- The physical location where the instance is to be placed.
- symbol FamilySymbol
- A FamilySymbol object that represents the type of the instance that is to be inserted.
- referenceDirection XYZ
- A vector that dictates the direction of certain family instances.
- host Element
- A host object into which the instance will be embedded
- structuralType StructuralType
- If structural then specify the type of the component.
Return Value
FamilyInstanceIf creation was successful then an instance to the new object is returned, otherwise
.
Exceptions
RemarksThis method allows you to create FamilyInstance objects that require both a location and direction.
If the instance fails to be created an exception may be thrown.
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.
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