Creates a new instance of a linked Revit project (RevitLinkType).
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since: 2018
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Parameters
- document
- Type: Autodesk.Revit.DBDocument
The document in which the new instance should be created.
- revitLinkTypeId
- Type: Autodesk.Revit.DBElementId
The element id of the RevitLinkType.
- placement
- Type: Autodesk.Revit.DBImportPlacement
The mode where to place the RevitLinkInstance. Set this option to place the view at the origin or by shared coordinates.
Return Value
The newly-created RevitLinkInstance.Remarks
Instances will be placed origin-to-origin or by shared coordinates. This function cannot be used to create instances of nested links.
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.ExceptionsArgumentException | revitLinkTypeId isn't a RevitLinkType. -or- revitLinkTypeId is not a top-level link. -or- revitLinkTypeId is not a loaded RevitLinkType -or- document is not a project document. -or- placement isn't supported.Only Origin or Shared placement is supported. |
Autodesk.Revit.ExceptionsArgumentNullException | A non-optional argument was null |
Autodesk.Revit.ExceptionsArgumentOutOfRangeException | A value passed for an enumeration argument is not a member of that enumeration |
Autodesk.Revit.ExceptionsInvalidOperationException | The placement is Shared, and the host model and the link do not share the same coordinate system. Or the placement is Shared, and the shared coordinates of the host model do not match the GIS coordinate system of the linked file. |
Autodesk.Revit.ExceptionsModificationForbiddenException | The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements). -or- The document is being loaded, or is in the midst of another sensitive process. |
Autodesk.Revit.ExceptionsModificationOutsideTransactionException | The document has no open transaction. |