RevitLinkTypeCreate(Document, ModelPath, RevitLinkOptions) Method |
Creates a new Revit link type and loads the linked document.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic static LinkLoadResult Create(
Document document,
ModelPath path,
RevitLinkOptions options
)
Public Shared Function Create (
document As Document,
path As ModelPath,
options As RevitLinkOptions
) As LinkLoadResult
public:
static LinkLoadResult^ Create(
Document^ document,
ModelPath^ path,
RevitLinkOptions^ options
)
static member Create :
document : Document *
path : ModelPath *
options : RevitLinkOptions -> LinkLoadResult
Parameters
- document Document
-
The document in which to create the Revit link.
- path ModelPath
-
The path of the link to load. This may be a path of local disk, Revit Server or Cloud.
This must be a full path.
- options RevitLinkOptions
-
An options class for loading Revit links.
Return Value
LinkLoadResult
An object containing the results of creating and loading
the Revit link type. It contains the ElementId of the new link.
Exceptions
Remarks
This function regenerates the input document.
While the options argument allows specification of a path type, the
input path argument must be a full path. Relative vs. absolute determines
how Revit will store the path, but it needs a complete path to find
the linked document initially.
Examplepublic ElementId CreateRevitLink(Document doc, string pathName)
{
FilePath path = new FilePath(pathName);
RevitLinkOptions options = new RevitLinkOptions(false);
LinkLoadResult result = RevitLinkType.Create(doc, path, options);
return (result.ElementId);
}
Public Function CreateRevitLink(doc As Document, pathName As String) As ElementId
Dim path As New FilePath(pathName)
Dim options As New RevitLinkOptions(False)
Dim result As LinkLoadResult = RevitLinkType.Create(doc, path, options)
Return (result.ElementId)
End Function
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also