Copies an existing model to a new file. Overwriting a file of the same name is allowed.
Namespace: Autodesk.Revit.ApplicationServices
Assembly: RevitAPI (in RevitAPI.dll) Version: 22.0.0.0 (22.1.0.0)
Since: 2012
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Parameters
- sourceModelPath
- Type: Autodesk.Revit.DB ModelPath
The path of the file-based or server-based source model.
- destFilePath
- Type: System String
The path of the destination file.
- overwrite
- Type: System Boolean
True if the destination file can be overwritten; otherwise, false.
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions ArgumentException | The given path sourceModelPath is a cloud path which is not supported in this method. |
Autodesk.Revit.Exceptions ArgumentNullException | A non-optional argument was null |
Autodesk.Revit.Exceptions CentralModelAccessDeniedException | Access to the central model was denied. A possible reason is because the model was under maintenance. |
Autodesk.Revit.Exceptions CentralModelException | The central model is missing. -or- An internal error happened on the central model, please contact the server administrator. |
Autodesk.Revit.Exceptions DirectoryNotFoundException | Thrown when the directory of destination file doesn't exist. |
Autodesk.Revit.Exceptions FileArgumentAlreadyExistsException | The destination file exists and can't be overwritten. -or- destFilePath is pointing to a folder that already exists and cannot be deleted. |
Autodesk.Revit.Exceptions FileArgumentNotFoundException | The Revit model specified by sourceModelPath doesn't exist. |
Autodesk.Revit.Exceptions InvalidPathArgumentException | The destination file name includes one or more invalid characters. |
Autodesk.Revit.Exceptions RevitServerCommunicationException | The server-based central model could not be accessed because of a network communication error. |
Autodesk.Revit.Exceptions RevitServerInternalException | An internal error happened on the server, please contact the server administrator. |