Creates an ExternalResourceReference representing a local file managed by Revit's built-in server.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since: 2015
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Parameters
- doc
- Type: Autodesk.Revit.DBDocument
The document containing the reference. If the PathType is relative, the path will be made relative to the location of this Document. (If this Document belongs to a workshared model, the reference will be relative to the central model.)
- resourceType
- Type: Autodesk.Revit.DBExternalResourceType
The type of the external resource.
- path
- Type: Autodesk.Revit.DBModelPath
A path to the external file. This path must be absolute. If the PathType is relative, then Revit will relativize the path according to the location of the given Document.
- pathType
- Type: Autodesk.Revit.DBPathType
An enum indicating the type of path which the ExternalResourceReference should use. The PathType must be PathType.Server if the reference is to a Revit model on Revit Server. The PathType must be PathType.Absolute if the reference is local but the host model or host's central model are on Revit Server.
Return Value
The newly-created ExternalResourceReference.Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.ExceptionsArgumentException | The PathType.Enum value is not valid for this resource type or Document location. PathType.Content is not valid for Revit links. The PathType must be PathType.Server if the resource is on Revit Server and is only valid for Revit links. The PathType must be PathType.Absolute if the host document or the host document's central model are on Revit Server. -or- The given path path is a cloud path which is not supported in this method. |
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 model is not allowed to access. |