RevitLinkInstanceCreate(Document, ElementId) Method |
Creates a new instance of a linked Revit project (RevitLinkType).
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 26.0.4.0 (26.0.4.0)
Syntaxpublic static RevitLinkInstance Create(
Document document,
ElementId revitLinkTypeId
)
Public Shared Function Create (
document As Document,
revitLinkTypeId As ElementId
) As RevitLinkInstance
public:
static RevitLinkInstance^ Create(
Document^ document,
ElementId^ revitLinkTypeId
)
static member Create :
document : Document *
revitLinkTypeId : ElementId -> RevitLinkInstance
Parameters
- document Document
-
The document in which the new instance should be created.
- revitLinkTypeId ElementId
-
The element id of the RevitLinkType.
Return Value
RevitLinkInstance
The newly-created RevitLinkInstance.
ExceptionsException | Condition |
---|
ArgumentException |
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.
|
ArgumentNullException |
A non-optional argument was null
|
ModificationForbiddenException |
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.
|
ModificationOutsideTransactionException |
The document has no open transaction.
|
Remarks
Instances will be placed origin-to-origin.
This function cannot be used to create instances
of nested links.
See Also