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: 26.1.0.0 (26.1.0.34)
Syntax
C#
public void CopyModel( ModelPath sourceModelPath, string destFilePath, bool overwrite )
Parameters
- sourceModelPath ModelPath
- The path of the file-based or server-based source model.
- destFilePath String
- The path of the destination file.
- overwrite Boolean
- True if the destination file can be overwritten; otherwise, false.
Exceptions
Exception | Condition |
---|---|
ArgumentException | The given path sourceModelPath is a cloud path which is not supported in this method. |
ArgumentNullException | A non-optional argument was null |
CentralModelAccessDeniedException | Access to the central model was denied. A possible reason is because the model was under maintenance. |
CentralModelException | The central model is missing. -or- An internal error happened on the central model, please contact the server administrator. |
DirectoryNotFoundException | Thrown when the directory of destination file doesn't exist. |
FileArgumentAlreadyExistsException | The destination file exists and can't be overwritten. -or- destFilePath is pointing to a folder that already exists and cannot be deleted. |
FileArgumentNotFoundException | The Revit model specified by sourceModelPath doesn't exist. |
InvalidPathArgumentException | The destination file name includes one or more invalid characters. |
RevitServerCommunicationException | The server-based central model could not be accessed because of a network communication error. |
RevitServerInternalException | An internal error happened on the server, please contact the server administrator. |