Namespace: Autodesk.Revit.Creation
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Parameters
- location
- Type: Autodesk.Revit.DBXYZ
The physical location where the instance is to be placed.
- symbol
- Type: Autodesk.Revit.DBFamilySymbol
A FamilySymbol object that represents the type of the instance that is to be inserted.
- level
- Type: Autodesk.Revit.DBLevel
The level onto which the FamilyInstance is to be placed.
- structuralType
- Type: Autodesk.Revit.DB.StructureStructuralType
If structural then specify the type of the component.
Return Value
If creation was successful then an instance to the new object is returned, otherwise a null reference (Nothing in Visual Basic).Remarks
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: ForbiddenForDynamicUpdateException might be thrown during a dynamic update if the inserted instance establishes a mutual dependency with another structure.
Note: if the created family instance includes nested instances, the API framework will automatically regenerate the document during this method call.
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.ExceptionsArgumentException | Thrown if the family symbol does not exist in the given document. |
Autodesk.Revit.ExceptionsArgumentException | Thrown if the level does not exist in the given document. |
Autodesk.Revit.ExceptionsArgumentException | Thrown if The symbol is not active. |